예제 #1
0
        // --------------------------------------------------------------------------------------------
        public static UnitModifierTotals CalculateTotals(List <UnitModifier> modifiers)
        {
            // create base modifier totals with default stats.
            UnitModifierTotals toReturn = UnitModifierTotals.Identity;

            return(toReturn);
        }
예제 #2
0
파일: Unit.cs 프로젝트: njelly/GridStrategy
        // --------------------------------------------------------------------------------------------
        private void ApplyModifier(UnitModifierData modifierData)
        {
            UnitModifier modifier = new UnitModifier(modifierData, _game, this);

            modifier.OnModifierExpired += Modifier_OnModifierExpired;
            _modifiers.Add(modifier);

            _modifierTotals = UnitModifier.CalculateTotals(_modifiers);
        }
예제 #3
0
파일: Unit.cs 프로젝트: njelly/GridStrategy
        // --------------------------------------------------------------------------------------------
        public Unit(UnitData data, Game game, Player owner) : base(data.id)
        {
            id = _idCounter++;
            _idToUnit.Add(this);

            _data  = data;
            _game  = game;
            _owner = owner;

            _modifiers      = new List <UnitModifier>();
            _modifierTotals = UnitModifierTotals.Identity;

            Health    = _data.health;
            MoveRange = _data.moveRange;

            Skill = new Skill(AppManager.Config.GetSkillData(_data.skillId), _game, this);
        }
예제 #4
0
파일: Unit.cs 프로젝트: njelly/GridStrategy
 // --------------------------------------------------------------------------------------------
 private void RemoveModifier(UnitModifier modifier)
 {
     _modifiers.Remove(modifier);
     modifier.OnModifierExpired -= Modifier_OnModifierExpired;
     _modifierTotals             = UnitModifier.CalculateTotals(_modifiers);
 }