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

            //SaveGame.TestSave.Save(_map);
        }
Exemplo n.º 7
0
 public VehicleNode(IntVector pos) : base(pos)
 {
 }
Exemplo n.º 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);
 }
Exemplo n.º 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;
 }
Exemplo n.º 10
0
 public bool IsParallelTo(IntVector vector) => this.ToVector2().IsParallelTo(vector.ToVector2());
Exemplo n.º 11
0
 public float Distance(IntVector dest) => (dest - this).ToVector2().Length();
Exemplo n.º 12
0
        public IntVector Direction8(IntVector dest)
        {
            var dir = Direction(dest).Round();

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