// this constructor will create a version of this object where it will target specific Units once the effect activates public DelayedEffect(Effect eff, UnitPositionStorage positions, int time, UnitType trigger, bool end, List <Unit> targets, Unit source) { effect = eff; globalPositionalData = positions; timer = time; triggerType = trigger; atEnd = end; areaOfEffect = null; effectTargets = targets; sourceUnit = source; }
// initialization private void Awake() { // there can only be one if (instance == null) { instance = this; } else { Destroy(this.gameObject); } currentTurn = 0; currentRound = 1; controllers = new List <UnitController>(); globalPositionalData = new UnitPositionStorage(); trapPositionalData = new TrapPositionStorage(globalPositionalData); delayedEffects = new List <DelayedEffect>(); }
// constructor. simply creates the storage Dictionary public TrapPositionStorage(UnitPositionStorage units) { storage = new Dictionary <Vector2Int, Trap>(); globalPositionalData = units; }