예제 #1
0
            public TilesetPreset(BinaryReader BR, int TileSizeX, int TileSizeY, int Index)
            {
                TilesetName = BR.ReadString();

                ArrayTerrain = new Terrain[BR.ReadInt32(), BR.ReadInt32()];
                ArrayTiles   = new DrawableTile[ArrayTerrain.GetLength(0), ArrayTerrain.GetLength(1)];

                //Tiles
                for (int Y = 0; Y < ArrayTerrain.GetLength(1); Y++)
                {
                    for (int X = 0; X < ArrayTerrain.GetLength(0); X++)
                    {
                        Terrain      NewTerrain = new Terrain(BR, X, Y);
                        DrawableTile NewTile    = new DrawableTile(new Rectangle(X * TileSizeX, Y * TileSizeY, TileSizeX, TileSizeY), Index);
                        ArrayTerrain[X, Y] = NewTerrain;
                        ArrayTiles[X, Y]   = NewTile;
                    }
                }

                ListBattleBackgroundAnimationPath = new List <string>();
                int ListBattleBackgroundAnimationPathCount = BR.ReadInt32();

                for (int B = 0; B < ListBattleBackgroundAnimationPathCount; B++)
                {
                    ListBattleBackgroundAnimationPath.Add(BR.ReadString());
                }
            }
예제 #2
0
            public TilesetPreset(string TilesetName, int TilesetWidth, int TilesetHeight, int TileSizeX, int TileSizeY, int Index)
            {
                this.TilesetName = TilesetName;

                ArrayTerrain = new Terrain[TilesetWidth / TileSizeX, TilesetHeight / TileSizeY];
                ArrayTiles   = new DrawableTile[ArrayTerrain.GetLength(0), ArrayTerrain.GetLength(1)];

                //Tiles
                for (int Y = 0; Y < ArrayTerrain.GetLength(1); Y++)
                {
                    for (int X = 0; X < ArrayTerrain.GetLength(0); X++)
                    {
                        Terrain      NewTerrain = new Terrain(X, Y);
                        DrawableTile NewTile    = new DrawableTile(new Rectangle(X * TileSizeX, Y * TileSizeY, TileSizeX, TileSizeY), Index);

                        NewTerrain.TerrainTypeIndex = 0;
                        NewTerrain.MVEnterCost      = 1;
                        NewTerrain.MVMoveCost       = 1;

                        NewTerrain.ListBonus      = new TerrainBonus[0];
                        NewTerrain.ListActivation = new TerrainActivation[0];
                        NewTerrain.ListBonusValue = new int[0];

                        ArrayTerrain[X, Y] = NewTerrain;
                        ArrayTiles[X, Y]   = NewTile;
                    }
                }
            }
예제 #3
0
 public DrawableTile(DrawableTile TilePreset)
     : this()
 {
     this.Origin       = TilePreset.Origin;
     this.TilesetIndex = TilePreset.TilesetIndex;
     if (TilePreset.Terrain3DInfo != null)
     {
         this.Terrain3DInfo = new Terrain3D(TilePreset.Terrain3DInfo);
     }
 }
예제 #4
0
        public void Load(BinaryReader BR)
        {
            ArrayTile = new DrawableTile[MapSize.X, MapSize.Y];

            for (int X = MapSize.X - 1; X >= 0; --X)
            {
                for (int Y = MapSize.Y - 1; Y >= 0; --Y)
                {
                    ArrayTile[X, Y] = new DrawableTile(BR, TileSize.X, TileSize.Y);
                }
            }
        }
예제 #5
0
        public Terrain3D(BinaryReader BR, int TileWidth, int TileHeight)
        {
            TerrainStyle = (TerrainStyles)BR.ReadByte();

            switch (TerrainStyle)
            {
            case TerrainStyles.Flat:
                break;

            default:
                FrontFace = new DrawableTile(BR, TileWidth, TileHeight);
                BackFace  = new DrawableTile(BR, TileWidth, TileHeight);
                LeftFace  = new DrawableTile(BR, TileWidth, TileHeight);
                RightFace = new DrawableTile(BR, TileWidth, TileHeight);
                break;
            }
        }
예제 #6
0
        public Terrain3D(Terrain3D Other)
        {
            TerrainStyle = Other.TerrainStyle;
            Transparancy = Other.Transparancy;

            switch (TerrainStyle)
            {
            case TerrainStyles.Flat:
                break;

            default:
                FrontFace = new DrawableTile(Other.FrontFace);
                BackFace  = new DrawableTile(Other.BackFace);
                LeftFace  = new DrawableTile(Other.LeftFace);
                RightFace = new DrawableTile(Other.RightFace);
                break;
            }
        }
예제 #7
0
        public TileAttributesEditor3D(DrawableTile TileInfo, BattleMap Owner)
        {
            InitializeComponent();

            this.TileInfo = TileInfo;
            this.Owner    = Owner;

            cbo3DStyle.SelectedIndex = (int)TileInfo.Terrain3DInfo.TerrainStyle;

            for (int T = 0; T < Owner.ListTilesetPreset.Count; T++)
            {
                cboTilesFront.Items.Add(Owner.ListTilesetPreset[T].TilesetName);
                cboTilesBack.Items.Add(Owner.ListTilesetPreset[T].TilesetName);
                cboTilesLeft.Items.Add(Owner.ListTilesetPreset[T].TilesetName);
                cboTilesRight.Items.Add(Owner.ListTilesetPreset[T].TilesetName);
            }

            if (Owner.ListTilesetPreset.Count > 0)
            {
                cboTilesFront.SelectedIndex = TileInfo.Terrain3DInfo.FrontFace.TilesetIndex;
                cboTilesBack.SelectedIndex  = TileInfo.Terrain3DInfo.BackFace.TilesetIndex;
                cboTilesLeft.SelectedIndex  = TileInfo.Terrain3DInfo.LeftFace.TilesetIndex;
                cboTilesRight.SelectedIndex = TileInfo.Terrain3DInfo.RightFace.TilesetIndex;
                TilesetViewerFront.InitTileset(Owner.ListTileSet[cboTilesFront.SelectedIndex], Owner.TileSize);
                TilesetViewerBack.InitTileset(Owner.ListTileSet[cboTilesBack.SelectedIndex], Owner.TileSize);
                TilesetViewerLeft.InitTileset(Owner.ListTileSet[cboTilesLeft.SelectedIndex], Owner.TileSize);
                TilesetViewerRight.InitTileset(Owner.ListTileSet[cboTilesRight.SelectedIndex], Owner.TileSize);

                TilesetViewerBack.ActiveTile  = TileInfo.Terrain3DInfo.FrontFace.Origin.Location;
                TilesetViewerFront.ActiveTile = TileInfo.Terrain3DInfo.BackFace.Origin.Location;
                TilesetViewerLeft.ActiveTile  = TileInfo.Terrain3DInfo.LeftFace.Origin.Location;
                TilesetViewerRight.ActiveTile = TileInfo.Terrain3DInfo.RightFace.Origin.Location;
            }
            else
            {
                TilesetViewerFront.InitTileset(string.Empty, Owner.TileSize);
                TilesetViewerBack.InitTileset(string.Empty, Owner.TileSize);
                TilesetViewerLeft.InitTileset(string.Empty, Owner.TileSize);
                TilesetViewerRight.InitTileset(string.Empty, Owner.TileSize);
            }

            TileViewer3D.ListTileSet = Owner.ListTileSet;
            UpdatePreview();
        }
예제 #8
0
            public TilesetPreset(BinaryReader BR, int TileSizeX, int TileSizeY, int Index)
            {
                TilesetName = BR.ReadString();

                ArrayTerrain = new Terrain[BR.ReadInt32(), BR.ReadInt32()];
                ArrayTiles   = new DrawableTile[ArrayTerrain.GetLength(0), ArrayTerrain.GetLength(1)];

                //Tiles
                for (int Y = 0; Y < ArrayTerrain.GetLength(1); Y++)
                {
                    for (int X = 0; X < ArrayTerrain.GetLength(0); X++)
                    {
                        Terrain      NewTerrain = new Terrain(BR, X, Y);
                        DrawableTile NewTile    = new DrawableTile(new Rectangle(X * TileSizeX, Y * TileSizeY, TileSizeX, TileSizeY), Index);
                        ArrayTerrain[X, Y] = NewTerrain;
                        ArrayTiles[X, Y]   = NewTile;
                    }
                }
            }
예제 #9
0
 public void ReplaceTile(int X, int Y, DrawableTile ReplacementTile)
 {
     this.ArrayTile[X, Y] = ReplacementTile;
 }
예제 #10
0
 public DrawableTile(DrawableTile TilePreset) : this()
 {
     this.Origin  = TilePreset.Origin;
     this.Tileset = TilePreset.Tileset;
 }