public void SetCurrentMap(TiledMap tiledMap) { var mapEquipmentOccupents = tiledMap.GetEquipmentOccupants(); foreach (var mapEquipmentOccupent in mapEquipmentOccupents) { if (mapEquipmentOccupent is SnackMachine) { AddAgent(mapEquipmentOccupent as SnackMachine); } else if (mapEquipmentOccupent is SodaMachine) { AddAgent(mapEquipmentOccupent as SodaMachine); } else if (mapEquipmentOccupent is WaterFountain) { AddAgent(mapEquipmentOccupent as WaterFountain); } else if (mapEquipmentOccupent is OfficeDesk) { AddAgent(mapEquipmentOccupent as OfficeDesk); } } currentMap = tiledMap; }