示例#1
0
 internal Combat_Metrics(int turn, CombatTypes type, Game_Unit attacker, int attacker_hp, int weapon_1_id, int attacker_attacks,
                         List <Combat_Map_Object> targets, List <int> target_hps, List <int> weapon_2_ids, List <int> targets_attacks)
 {
     Turn       = turn;
     CombatType = type.ToString();
     Attacker   = new Combatant_Metric(attacker, attacker_hp, weapon_1_id, attacker_attacks);
     Targets    = targets == null ? new List <Combatant_Metric>() : Enumerable.Range(0, targets.Count)
                  .Select(x => new Combatant_Metric(targets[x], target_hps[x], weapon_2_ids[x], targets_attacks[x])).ToList();
 }
        public static CombatState CreateCombatState(CombatTypes type)
        {
            CombatState combatState;

            switch (type)
            {
            case CombatTypes.Default:
                combatState = new PlayerSwordState();
                break;

            case CombatTypes.Aiming:
                combatState = new PlayerAimingState();
                break;

            default:
                throw new NotImplementedException("Combat state is not recognized.");
            }
            return(combatState);
        }
示例#3
0
 internal void add_combat(int turn, CombatTypes type, Game_Unit attacker, int attacker_hp, int weapon_1_id, int attacker_attacks,
                          List <Combat_Map_Object> targets, List <int> target_hps, List <int> weapon_2_ids, List <int> targets_attacks)
 {
     Combats.Add(new Combat_Metrics(turn, type, attacker, attacker_hp, weapon_1_id, attacker_attacks,
                                    targets, target_hps, weapon_2_ids, targets_attacks));
 }