Exemplo n.º 1
0
        public static StreetLight GetStreetLight(StreetLightType streetLightType, int index)
        {
            int jump = ((int)streetLightType * 4) + index;

            return((StreetLight)mapObjectTypeList[MapObjectType.STREETLIGHT][jump]);
        }
Exemplo n.º 2
0
        private static void AddToStreetLightList(Dictionary <int, MapObjectProperties> streetLightList, StreetLightType streetLightType, LightType lightType, Vector2 lightOffset, MapObjectShadowType shadowType, Point objectSize, Point shadowPointLeft, Point shadowPointTop, bool alwaysOn, int elevation)
        {
            int rowIndex = (int)streetLightType * 4;

            for (int i = 0; i < 4; i++)
            {
                Piece   piece = PieceController.GetPiece(10, rowIndex + i);
                Light   light = GraphicsManager.GetLight(lightType);
                Vector2 currentLightOffset = RotateVectorRight(lightOffset, GroundLayerController.tileSize, i);
                float   radian             = RotateRadiansRight(0, i);
                Point   shadowPointOffset  = GetShadowPoint(shadowPointLeft, shadowPointTop, GroundLayerController.tileSize, i, objectSize);
                Shadow  shadowLeft         = new Shadow(ShadowSpriteController.GetShadowSprite(shadowType, ShadowSide.LEFT, i), 0, 0, ShadowSide.LEFT, i, shadowPointOffset);
                Shadow  shadowRight        = new Shadow(ShadowSpriteController.GetShadowSprite(shadowType, ShadowSide.RIGHT, i), 0, 0, ShadowSide.RIGHT, i, shadowPointOffset);
                streetLightList.Add(rowIndex + i, new StreetLight(piece, light, currentLightOffset, radian, shadowLeft, shadowRight, shadowPointOffset, alwaysOn, elevation));
            }
        }