public Intersection GetIntersection() { MapObjectProperties mapObjectProperties = GetMapObjectProperties(); if (mapObjectProperties != null && mapObject.GetMapObjectType() == MapObjectType.STOPLIGHT) { StopLight stopLight = (StopLight)mapObjectProperties; return(stopLight.GetControllingIntersection()); } return(null); }
public MapObject(MapObjectProperties mapObjectProperties, int tileX, int tileY, Color color, float scale) { this.mapObjectProperties = mapObjectProperties; this.tileX = tileX; this.tileY = tileY; id = WorldController.GetNextMapObjectId(); this.color = color; this.scale = scale; if (mapObjectProperties.possibleInTileShift > 0) { int x = GameController.rnd.Next(mapObjectProperties.possibleInTileShift * -1, mapObjectProperties.possibleInTileShift); int y = GameController.rnd.Next(mapObjectProperties.possibleInTileShift * -1, mapObjectProperties.possibleInTileShift); smallOffset = new Vector2(x, y); } }