Esempio n. 1
0
 internal Player(PlayerState state)
 {
     _weaponDamage      = state.WeaponDamage;
     _cumulativeAbility = state.CumulativeAbility;
     _playerHp          = state.PlayerHp;
     _skillIds          = new HashSet <int>(state.SkillIds);
     PlayerId           = state.PlayerId;
     _votedToEndBattle  = state.VotedToEndBattle;
 }
Esempio n. 2
0
 public PlayerState(
     string playerId,
     WeaponDamage weaponDamage,
     Ability cumulativeAbility,
     PlayerHp playerHp,
     IEnumerable <int> skillIds,
     bool votedToEndBattle)
 {
     PlayerId          = playerId;
     WeaponDamage      = weaponDamage;
     CumulativeAbility = cumulativeAbility;
     PlayerHp          = playerHp;
     SkillIds          = skillIds;
     VotedToEndBattle  = votedToEndBattle;
 }
Esempio n. 3
0
        public Player(
            string playerId,
            WeaponDamage weaponDamage,
            Ability cumulativeAbility,
            PlayerHp playerHp,
            IEnumerable <int> skillIds)
        {
            PlayerId           = playerId;
            _weaponDamage      = weaponDamage;
            _cumulativeAbility = cumulativeAbility;
            _playerHp          = playerHp;
            _skillIds          = new HashSet <int>(skillIds);

            // Hack: just in case somebody holds reference to mutable types
            // after creating Player instance.
            _playerHp = new PlayerHp(playerHp.Current, playerHp.Maximum);

            // Methods should be internal so only Battle class can access them.
        }