Example #1
0
 public ref Tile GetTile(IntVector pos) => ref Tiles[pos.X, pos.Y];
Example #2
0
 public VehiclePath?GetPath(IntVector pos) => VehiclePaths.GetPath(pos);
Example #3
0
 public void DeletePathSegment(IntVector pos) => _pathBuilder.DeletePathSegment(pos);
Example #4
0
 public void BuildPath(PathType type, IntVector source, IntVector dest, bool buildFixed = false)
 {
     _pathBuilder.BuildPath(type, source, dest, buildFixed);
 }
Example #5
0
 public VehicleNode?GetNode(IntVector pos) => VehiclePaths.GetNode(pos);
Example #6
0
        public override void DeletePathSegment(IntVector pos)
        {
            base.DeletePathSegment(pos);

            //SaveGame.TestSave.Save(_map);
        }
Example #7
0
 public VehicleNode(IntVector pos) : base(pos)
 {
 }
Example #8
0
 public override bool CanBuildAt(PathType type, IntVector pos, Vector2 direction)
 {
     if (_map.GetBuilding(pos) != null) return false;
     return base.CanBuildAt(type, pos, direction);
 }
Example #9
0
 public override void BuildPath(PathType type, IntVector source, IntVector dest, bool buildFixed = false)
 {
     base.BuildPath(type, source, dest, buildFixed);
     if (source == dest) return;
 }
Example #10
0
 public bool IsParallelTo(IntVector vector) => this.ToVector2().IsParallelTo(vector.ToVector2());
Example #11
0
 public float Distance(IntVector dest) => (dest - this).ToVector2().Length();
Example #12
0
        public IntVector Direction8(IntVector dest)
        {
            var dir = Direction(dest).Round();

            return(new IntVector((int)dir.X, (int)dir.Y));
        }
Example #13
0
 public Vector2 Direction(IntVector dest) => Vector2.Normalize((dest - this).ToVector2()).Round(2);
Example #14
0
 public PathNode(IntVector pos)
 {
     Pos          = pos;
     _connections = new Dictionary <TNode, TPath>();
 }