コード例 #1
0
 private void UpdateCommands()
 {
     for (int i = 0; i < currentCommands.Count - 1; i++)
     {
         currentCommands[i] = new SwitchOutWeaponCommand(this, player.Inventory.Weapons[i]);
     }
 }
コード例 #2
0
        private List <ISpellswordCommand> GenerateCommands()
        {
            List <ISpellswordCommand> commands = new List <ISpellswordCommand>();

            foreach (IWeapon weapon in player.Inventory.Weapons)
            {
                SwitchOutWeaponCommand command = new SwitchOutWeaponCommand(this, weapon);
                commands.Add(command);
            }
            return(commands);
        }