示例#1
0
        public void Execute(string[] input, IKingdomRepository repository)
        {
            var commandName = input[0];

            if (commandName == "Kill")
            {
                var guardName = input[1];
                repository.TryRemoveGuard(guardName);
            }

            if (commandName == "Attack")
            {
                repository.King.GetAttacked();
            }
        }
示例#2
0
 public Engine(IKingdomRepository repo)
 {
     this.repository = repo;
     this.executor   = new CommandExecutor();
 }
示例#3
0
文件: Engine.cs 项目: yosifov/oop
 public Engine()
 {
     this.repository = new KingdomRepository();
 }