Example #1
0
        public void AddAction(string playerA, string playerB, ActionType actionType, ModifierType modifyer, Weapon weapon, WhereType where, ArmyType teamA, ArmyType teamB)
        {
            Player playerGet = getPlayer(playerA, teamA);
            Player playerDo = null;
            
            //damage from the world (harrier, falling) will not be considered in this version
            if (playerB == string.Empty)
            {
                playerDo = playerGet;
            } else
            {
                playerDo = getPlayer(playerB, teamB);
            }

            switch (actionType)
            {
                case ActionType.Kill:
                    playerGet.AddAction(playerDo, ActionType.Die, modifyer, weapon, where);
                    playerDo.AddAction(playerGet, ActionType.Kill, modifyer, weapon, where);
                    break;
                case ActionType.Damage:
                    playerGet.AddAction(playerDo, ActionType.Damage, modifyer, weapon, where);
                    playerDo.AddAction(playerGet, ActionType.Damage, modifyer, weapon, where);
                    break;
            }
        }
 public void AddAction(Player playerTo, ActionType actionType, ModifierType modifier, Weapon weapon, WhereType where)
 {
     listAction.Add(new Action() { PlayerTo = playerTo, ActionType = actionType, Modifier = modifier, Weapon = weapon, Where = where}); 
 }