public UnitBase(UnitBase setFrom) { unitName = setFrom.unitName; perceptionData = setFrom.perceptionData; currentLocation = setFrom.currentLocation; previousLocation = setFrom.previousLocation; enemy = setFrom.enemy; ID = setFrom.ID++; chasing = setFrom.chasing; //Whenever you copy a unit, you know the starting state is the copied unit's most recent perception startingPerceptionState = setFrom.perceptionData; }
//Does this need to add a baseunit? public void AddUnit(UnitBase toAdd) { units[UnitType.Bender] = toAdd; //I think this removes bender GetUnitSquare[UnitType.Bender].UnitsPresent[UnitType.Bender] = true; //bender added }