public ref Tile GetTile(IntVector pos) => ref Tiles[pos.X, pos.Y];
public VehiclePath?GetPath(IntVector pos) => VehiclePaths.GetPath(pos);
public void DeletePathSegment(IntVector pos) => _pathBuilder.DeletePathSegment(pos);
public void BuildPath(PathType type, IntVector source, IntVector dest, bool buildFixed = false) { _pathBuilder.BuildPath(type, source, dest, buildFixed); }
public VehicleNode?GetNode(IntVector pos) => VehiclePaths.GetNode(pos);
public override void DeletePathSegment(IntVector pos) { base.DeletePathSegment(pos); //SaveGame.TestSave.Save(_map); }
public VehicleNode(IntVector pos) : base(pos) { }
public override bool CanBuildAt(PathType type, IntVector pos, Vector2 direction) { if (_map.GetBuilding(pos) != null) return false; return base.CanBuildAt(type, pos, direction); }
public override void BuildPath(PathType type, IntVector source, IntVector dest, bool buildFixed = false) { base.BuildPath(type, source, dest, buildFixed); if (source == dest) return; }
public bool IsParallelTo(IntVector vector) => this.ToVector2().IsParallelTo(vector.ToVector2());
public float Distance(IntVector dest) => (dest - this).ToVector2().Length();
public IntVector Direction8(IntVector dest) { var dir = Direction(dest).Round(); return(new IntVector((int)dir.X, (int)dir.Y)); }
public Vector2 Direction(IntVector dest) => Vector2.Normalize((dest - this).ToVector2()).Round(2);
public PathNode(IntVector pos) { Pos = pos; _connections = new Dictionary <TNode, TPath>(); }