-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIGraph.cs
35 lines (31 loc) · 1.01 KB
/
IGraph.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using UnityEngine;
namespace AStar
{
/// <summary>
/// Graph representation
/// </summary>
public interface IGraph
{
/// <summary>
/// Graph horizontal node count
/// </summary>
int Width { get; }
/// <summary>
/// Graph vertical node count
/// </summary>
int Height { get; }
/// <summary>
/// Get a transition cost from one point to second
/// </summary>
/// <param name="from"> first node address </param>
/// <param name="to"> second node address </param>
/// <returns> cost of a transition </returns>
float GetTransition(Vector2Int from, Vector2Int to);
/// <summary>
/// Set or rewrite a transition cost from one point to second
/// </summary>
/// <param name="from"> first node address </param>
/// <param name="to"> second node address </param>
void SetTransition(Vector2Int from, Vector2Int to, float cost);
}
}