Пример #1
0
        public Intersection GetIntersection()
        {
            MapObjectProperties mapObjectProperties = GetMapObjectProperties();

            if (mapObjectProperties != null && mapObject.GetMapObjectType() == MapObjectType.STOPLIGHT)
            {
                StopLight stopLight = (StopLight)mapObjectProperties;
                return(stopLight.GetControllingIntersection());
            }
            return(null);
        }
Пример #2
0
 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);
     }
 }