/// <summary> /// when a tower is added by its data, /// this is called to add the game state /// and the new tower to the list of /// game data /// </summary> /// <param name="tower">data of the new tower</param> public void towerAdded(EntityData tower) { if (pathOut == -1) { return; } InputRecord _in = getGameState(); IODSetup data = new IODSetup() { frame = m.frames.frame, input = _in, output = tower }; defends.defends.Add(data); }
void modifyDefenceOutput(int idx) { IODSetup d = defends.defends[idx]; IODSetup newSet = new IODSetup() { frame = d.frame, input = d.input, output = new EntityData() { health = d.output.health, type = d.output.type, x = d.output.x + (Random.Range(-0.05f, 0.05f)), y = d.output.y + (Random.Range(-0.05f, 0.05f)) } }; defends.defends[idx] = newSet; }