Пример #1
0
 // Constructors.
 public Cell(BasicTile tile, BasicUnit unit = null, BasicObject obj = null)
 {
     Position = new Coordinates();
     Tile     = tile;
     Unit     = unit;
     Object   = obj;
 }
Пример #2
0
        // For performance.
        public bool Equals(BasicTile tile)
        {
            if (tile == null)
            {
                return(false);
            }

            return(Type.Equals(tile.Type));
        }
Пример #3
0
        // Equality override.
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            // If obj can not be cast to BasicTile.
            BasicTile tile = obj as BasicTile;

            if (tile == null)
            {
                return(false);
            }

            return(Type.Equals(tile.Type));
        }
Пример #4
0
 public Cell(Coordinates position, BasicTile tile, BasicUnit unit = null, BasicObject obj = null) : this(tile, unit, obj)
 {
     Position = position;
 }