Пример #1
0
        /// <summary>
        /// NO ANIMATION SUPPORT FOR NOW! No support for all sides for now.
        /// </summary>
        /// <param name="spriteBatch"></param>
        /// <param name="construction"></param>
        public static void DrawConstruction(SpriteBatch spriteBatch, CustomConstruction construction)
        {
            var     entityManager = GnomanEmpire.Instance.EntityManager;
            var     map           = GnomanEmpire.Instance.Map;
            float   lightLevel    = construction.Cell().LightLevel;
            Color   color         = map.TerrainProperties[construction.MaterialID].ConvertColor(lightLevel);
            Color   color2        = GameEntity.Darken(TileDef.NoTintColor, lightLevel);
            Vector2 pos           = GnomanEmpire.Instance.Camera.MapIndexToScreenCoords(construction.Position);

            foreach (var drawableComponent in construction.Drawables)
            {
                drawableComponent.Entity.Draw(spriteBatch, pos, (drawableComponent.MaterialIndex == 0) ? color : color2);
            }

            /*
             * TileDesc[] array = construction.ConstructionDef.TileIDs;
             * if (construction.Animation != null)
             * {
             *  array = construction.Animation.TileDescs();
             * }
             * TileDesc[] array2 = array;
             * for (int i = 0; i < array2.Length; i++)
             * {
             *  TileDesc tileDesc = array2[i];
             *  int num = (int)tileDesc.GetTileID((Material)construction.MaterialID);
             *  if (construction.ConstructionDef.Rotates)
             *  {
             *      Camera camera = GnomanEmpire.Instance.Camera;
             *      num = (int)(num + ((int)construction.Orientation + (int)camera.Orientation) % (int)CameraOrientation.Count);
             *  }
             *  entityManager.DrawObjectIsoTile(spriteBatch, map.TileDef(num), pos, (tileDesc.MaterialIndex == 0) ? color : color2);
             * }
             */
        }
        /// <summary>
        /// NO ANIMATION SUPPORT FOR NOW! No support for all sides for now.
        /// </summary>
        /// <param name="spriteBatch"></param>
        /// <param name="construction"></param>
        public static void DrawConstruction(SpriteBatch spriteBatch, CustomConstruction construction)
        {
            var entityManager = GnomanEmpire.Instance.EntityManager;
            var map = GnomanEmpire.Instance.Map;
            float lightLevel = construction.Cell().LightLevel;
            Color color = map.TerrainProperties[construction.MaterialID].ConvertColor(lightLevel);
            Color color2 = GameEntity.Darken(TileDef.NoTintColor, lightLevel);
            Vector2 pos = GnomanEmpire.Instance.Camera.MapIndexToScreenCoords(construction.Position);

            foreach (var drawableComponent in construction.Drawables)
            {
                drawableComponent.Entity.Draw(spriteBatch, pos, (drawableComponent.MaterialIndex == 0) ? color : color2);
            }

            /*
            TileDesc[] array = construction.ConstructionDef.TileIDs;
            if (construction.Animation != null)
            {
                array = construction.Animation.TileDescs();
            }
            TileDesc[] array2 = array;
            for (int i = 0; i < array2.Length; i++)
            {
                TileDesc tileDesc = array2[i];
                int num = (int)tileDesc.GetTileID((Material)construction.MaterialID);
                if (construction.ConstructionDef.Rotates)
                {
                    Camera camera = GnomanEmpire.Instance.Camera;
                    num = (int)(num + ((int)construction.Orientation + (int)camera.Orientation) % (int)CameraOrientation.Count);
                }
                entityManager.DrawObjectIsoTile(spriteBatch, map.TileDef(num), pos, (tileDesc.MaterialIndex == 0) ? color : color2);
            }
            */
        }