97 lines
1.6 KiB
C#
97 lines
1.6 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using Microsoft.Xna.Framework;
|
|
using Microsoft.Xna.Framework.Input;
|
|
using Microsoft.Xna.Framework.Graphics;
|
|
|
|
class Nodes
|
|
{
|
|
private int F = 0;
|
|
private int G = 0;
|
|
private int H = 0;
|
|
private Vector2 Coordinates;
|
|
private Nodes Parent = null;
|
|
private int Direction = 0;
|
|
|
|
public Nodes(Vector2 coordinates)
|
|
{
|
|
Coordinates = coordinates;
|
|
}
|
|
|
|
public Nodes(Vector2 coordinates, int direction)
|
|
{
|
|
Coordinates = coordinates;
|
|
Direction = direction;
|
|
}
|
|
|
|
public Nodes(Nodes node)
|
|
{
|
|
F = node.F;
|
|
G = node.G;
|
|
H = node.H;
|
|
Coordinates = node.Coordinates;
|
|
Parent = node.Parent;
|
|
}
|
|
|
|
public Nodes(int f, int g, int h, Vector2 coordinates, Nodes parent)
|
|
{
|
|
F = f;
|
|
G = g;
|
|
H = h;
|
|
Coordinates = coordinates;
|
|
Parent = parent;
|
|
}
|
|
|
|
public Vector2 getCords()
|
|
{
|
|
return Coordinates;
|
|
}
|
|
|
|
public int getF()
|
|
{
|
|
return F;
|
|
}
|
|
|
|
public int getG()
|
|
{
|
|
return G;
|
|
}
|
|
|
|
public int getH()
|
|
{
|
|
return H;
|
|
}
|
|
|
|
public void calculateF()
|
|
{
|
|
F = G + H;
|
|
}
|
|
|
|
public void setG(int g)
|
|
{
|
|
G = g;
|
|
}
|
|
|
|
public void setH(int h)
|
|
{
|
|
H = h;
|
|
}
|
|
|
|
public Nodes getParent()
|
|
{
|
|
return Parent;
|
|
}
|
|
|
|
public void setParent(Nodes parent)
|
|
{
|
|
Parent = parent;
|
|
}
|
|
|
|
public int getDirection()
|
|
{
|
|
return Direction;
|
|
}
|
|
} |