/// <summary> /// Creates a perfect clone of this Tile. /// </summary> /// <returns>A copy of the Tile object.</returns> public Tile Clone() { Tile newTile = new Tile(_graphic) { Name = Name }; return newTile; }
public bool CheckObstructions(ref Vector2f pos, ref Vector2f tileOffset, Tile tile) { Line[] baselines = _innerSS.GetLineBase(); Vector2f my_pos = pos - new Vector2f(_base.Left, _base.Top); foreach (Line b in baselines) { var lineA = b.Offset(my_pos); foreach (Line l in tile.Obstructions) { var lineB = l.Offset(tileOffset); if (Line.Intersects(lineA, lineB)) return true; } } return false; }