Ejemplo n.º 1
0
        public bool Equals(AutoTile other)
        {
            if (other == null)
            {
                return(false);
            }

            if (AutoTileset > -1)
            {
                return(AutoTileset == other.AutoTileset && BorderTileset == other.BorderTileset);
            }

            if (Layers.Count != other.Layers.Count)
            {
                return(false);
            }

            for (int ii = 0; ii < Layers.Count; ii++)
            {
                if (Layers[ii] != other.Layers[ii])
                {
                    return(false);
                }
            }

            return(true);
        }
Ejemplo n.º 2
0
        public Map()
        {
            Name    = new LocalText();
            Comment = "";
            Music   = "";

            TileSight = SightRange.Clear;
            CharSight = SightRange.Clear;

            TeamSpawns = new SpawnList <TeamSpawner>();
            ItemSpawns = new SpawnList <InvItem>();

            BlankBG = new AutoTile();

            PrepareEvents = new List <SingleCharEvent>();
            StartEvents   = new List <SingleCharEvent>();
            CheckEvents   = new List <SingleCharEvent>();

            Status = new Dictionary <int, MapStatus>();

            FloorBG    = new AutoTile();
            TextureMap = new Dictionary <int, AutoTile>();

            CurrentTurnMap = new TurnState();
        }
Ejemplo n.º 3
0
        public Map()
        {
            AssetName = "";
            Name      = new LocalText();
            Comment   = "";
            Music     = "";

            ScriptEvents = new Dictionary <LuaEngine.EDungeonMapCallbacks, ScriptEvent>();

            TileSight = SightRange.Clear;
            CharSight = SightRange.Clear;

            TeamSpawns = new SpawnList <TeamSpawner>();
            ItemSpawns = new CategorySpawnChooser <InvItem>();

            Background = new MapBG();
            BlankBG    = new AutoTile();

            MapEffect   = new ActiveEffect();
            CheckEvents = new List <SingleCharEvent>();

            Status = new Dictionary <int, MapStatus>();

            TextureMap = new Dictionary <int, AutoTile>();

            CurrentTurnMap = new TurnState();
        }
Ejemplo n.º 4
0
 protected AutoTile(AutoTile other) : this()
 {
     foreach (TileLayer layer in other.Layers)
     {
         Layers.Add(new TileLayer(layer));
     }
     AutoTileset   = other.AutoTileset;
     BorderTileset = other.BorderTileset;
 }
Ejemplo n.º 5
0
 public void CreateNew(int width, int height)
 {
     Tiles = new AutoTile[width][];
     for (int ii = 0; ii < width; ii++)
     {
         Tiles[ii] = new AutoTile[height];
         for (int jj = 0; jj < height; jj++)
         {
             Tiles[ii][jj] = new AutoTile();
         }
     }
 }
Ejemplo n.º 6
0
 protected AutoTile(AutoTile other) : this()
 {
     foreach (TileLayer layer in other.Layers)
     {
         Layers.Add(new TileLayer(layer));
     }
     AutoTileset  = other.AutoTileset;
     NeighborCode = other.NeighborCode;
     foreach (int tile in other.Associates)
     {
         Associates.Add(tile);
     }
 }
Ejemplo n.º 7
0
        protected MapLayer(MapLayer other)
        {
            Name    = other.Name;
            Front   = other.Front;
            Visible = other.Visible;


            Tiles = new AutoTile[other.Tiles.Length][];
            for (int ii = 0; ii < other.Tiles.Length; ii++)
            {
                Tiles[ii] = new AutoTile[other.Tiles[0].Length];
                for (int jj = 0; jj < other.Tiles[0].Length; jj++)
                {
                    Tiles[ii][jj] = other.Tiles[ii][jj].Copy();
                }
            }
        }
Ejemplo n.º 8
0
        public bool Equals(AutoTile other)
        {
            if (other == null)
            {
                return(false);
            }
            if (AutoTileset != other.AutoTileset)
            {
                return(false);
            }

            if (AutoTileset > -1)
            {
                if (Associates.Count != other.Associates.Count)
                {
                    return(false);
                }
                foreach (int tile in Associates)
                {
                    if (!other.Associates.Contains(tile))
                    {
                        return(false);
                    }
                }
                return(true);
            }
            else
            {
                if (Layers.Count != other.Layers.Count)
                {
                    return(false);
                }

                for (int ii = 0; ii < Layers.Count; ii++)
                {
                    if (Layers[ii] != other.Layers[ii])
                    {
                        return(false);
                    }
                }

                return(true);
            }
        }
Ejemplo n.º 9
0
 protected Tile(Tile other)
 {
     Data      = other.Data.Copy();
     FloorTile = other.FloorTile.Copy();
     Effect    = new EffectTile(other.Effect);
 }
Ejemplo n.º 10
0
 public Tile(int type, Loc loc)
 {
     Data      = new TerrainTile(type);
     FloorTile = new AutoTile();
     Effect    = new EffectTile(loc);
 }
Ejemplo n.º 11
0
 public Tile()
 {
     Data      = new TerrainTile();
     FloorTile = new AutoTile();
     Effect    = new EffectTile();
 }
Ejemplo n.º 12
0
 protected TerrainTile(TerrainTile other)
 {
     ID      = other.ID;
     TileTex = other.TileTex.Copy();
 }
Ejemplo n.º 13
0
 public TerrainTile(int index, AutoTile tex)
 {
     ID      = index;
     TileTex = tex;
 }
Ejemplo n.º 14
0
 public TerrainTile()
 {
     TileTex = new AutoTile();
 }