Line | |
---|
1 | using System; |
---|
2 | using System.Collections.Generic; |
---|
3 | using System.Linq; |
---|
4 | using System.Text; |
---|
5 | |
---|
6 | namespace IsometricEngineTest.Ai |
---|
7 | { |
---|
8 | public class Node |
---|
9 | { |
---|
10 | private int x, z; |
---|
11 | private Node parent; |
---|
12 | private int travelCost, estimatedCost, totalCost; |
---|
13 | private bool isOpen, isClosed; |
---|
14 | |
---|
15 | public Node(int x, int z, Node parent, int travelCost, int estimatedCost, bool isOpen, bool isClosed) |
---|
16 | { |
---|
17 | this.x = x; |
---|
18 | this.z = z; |
---|
19 | this.parent = parent; |
---|
20 | this.travelCost = travelCost; |
---|
21 | this.isOpen = isOpen; |
---|
22 | this.isClosed = isClosed; |
---|
23 | this.estimatedCost = estimatedCost; |
---|
24 | |
---|
25 | totalCost = travelCost + estimatedCost; |
---|
26 | } |
---|
27 | |
---|
28 | public int X { get { return x; } } |
---|
29 | |
---|
30 | public int Z { get { return z; } } |
---|
31 | |
---|
32 | public Node Parent { get { return parent; } } |
---|
33 | |
---|
34 | public int TotalCost { get { return totalCost; } } |
---|
35 | |
---|
36 | public int TravelCost { get { return travelCost; } } |
---|
37 | |
---|
38 | public bool IsOpen |
---|
39 | { |
---|
40 | set { isOpen = value; } |
---|
41 | get { return isOpen; } |
---|
42 | } |
---|
43 | |
---|
44 | public bool IsClosed |
---|
45 | { |
---|
46 | set { isClosed = value; } |
---|
47 | get { return isClosed; } |
---|
48 | } |
---|
49 | } |
---|
50 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.