diff --git a/csharp/annalyns-infiltration/AnnalynsInfiltration.cs b/csharp/annalyns-infiltration/AnnalynsInfiltration.cs index 86e2bcd..b186f2e 100644 --- a/csharp/annalyns-infiltration/AnnalynsInfiltration.cs +++ b/csharp/annalyns-infiltration/AnnalynsInfiltration.cs @@ -4,21 +4,30 @@ static class QuestLogic { 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) { - throw new NotImplementedException("Please implement the (static) QuestLogic.CanSpy() method"); + return knightIsAwake || archerIsAwake || 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) { - throw new NotImplementedException("Please implement the (static) QuestLogic.CanFreePrisoner() method"); + if (petDogIsPresent && !archerIsAwake) + { + return true; + } + if (!petDogIsPresent && !archerIsAwake && !knightIsAwake && prisonerIsAwake) + { + return true; + } + + return false; } }