// Constructors. public Cell(BasicTile tile, BasicUnit unit = null, BasicObject obj = null) { Position = new Coordinates(); Tile = tile; Unit = unit; Object = obj; }
// For performance. public bool Equals(BasicTile tile) { if (tile == null) { return(false); } return(Type.Equals(tile.Type)); }
// 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)); }
public Cell(Coordinates position, BasicTile tile, BasicUnit unit = null, BasicObject obj = null) : this(tile, unit, obj) { Position = position; }