Solve csharp/exercises/annalyns-infiltration
This commit is contained in:
parent
dd395435af
commit
a0e547b483
|
@ -4,21 +4,30 @@ static class QuestLogic
|
||||||
{
|
{
|
||||||
public static bool CanFastAttack(bool knightIsAwake)
|
public static bool CanFastAttack(bool knightIsAwake)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException("Please implement the (static) QuestLogic.CanFastAttack() method");
|
return !knightIsAwake;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool CanSpy(bool knightIsAwake, bool archerIsAwake, bool prisonerIsAwake)
|
public static bool CanSpy(bool knightIsAwake, bool archerIsAwake, bool prisonerIsAwake)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException("Please implement the (static) QuestLogic.CanSpy() method");
|
return knightIsAwake || archerIsAwake || prisonerIsAwake;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool CanSignalPrisoner(bool archerIsAwake, bool prisonerIsAwake)
|
public static bool CanSignalPrisoner(bool archerIsAwake, bool prisonerIsAwake)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException("Please implement the (static) QuestLogic.CanSignalPrisoner() method");
|
return !archerIsAwake && prisonerIsAwake;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool CanFreePrisoner(bool knightIsAwake, bool archerIsAwake, bool prisonerIsAwake, bool petDogIsPresent)
|
public static bool CanFreePrisoner(bool knightIsAwake, bool archerIsAwake, bool prisonerIsAwake, bool petDogIsPresent)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException("Please implement the (static) QuestLogic.CanFreePrisoner() method");
|
if (petDogIsPresent && !archerIsAwake)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (!petDogIsPresent && !archerIsAwake && !knightIsAwake && prisonerIsAwake)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue