MegaMan.Editor.Bll.Tools.MultiTileBrush.AddTile C# (CSharp) Method

AddTile() public method

public AddTile ( Tile tile, int x, int y ) : void
tile MegaMan.Common.Tile
x int
y int
return void
        public void AddTile(Tile tile, int x, int y)
        {
            TileBrushCell cell = new TileBrushCell { x = x, y = y, tile = tile };
            _cells[x][y] = cell;
        }

Usage Example

Ejemplo n.º 1
0
        private void LoadBrushes()
        {
            var path = GetBrushFilePath();

            if (!System.IO.File.Exists(path)) return;

            using (var stream = new System.IO.StreamReader(path))
            {
                while (!stream.EndOfStream)
                {
                    string line = stream.ReadLine();
                    if (line == null) break;

                    string[] info = line.Split(' ');

                    var brush = new MultiTileBrush(int.Parse(info[0]), int.Parse(info[1]));

                    int x = 0; int y = 0;
                    for (int i = 2; i < info.Length; i++)
                    {
                        int id = int.Parse(info[i]);
                        if (id >= 0) brush.AddTile(Tileset[id], x, y);

                        y++;
                        if (y >= brush.Height)
                        {
                            y = 0;
                            x++;
                        }
                    }

                    _brushes.Add(brush);
                }
            }
        }
All Usage Examples Of MegaMan.Editor.Bll.Tools.MultiTileBrush::AddTile