Assets/Scripts/State.cs
/// <summary>
/// Gets the current state of the world
/// </summary>
/// <returns>The current state</returns>
Gets the current state of the world
Gets the current state of the world
public static State GetCurrentState()
    {
        var digger = GameObject.FindObjectOfType<Digger>();
        var playerLocation = digger.transform.position;
        var dist = LevelManager.instance.GetShortestPathDistance(digger.startX, digger.startY, (int)playerLocation.x, (int)playerLocation.y);
        return new State((int)playerLocation.x, (int)playerLocation.y, dist, LevelManager.instance.GetLevel(), digger.availableKeys);
    }
public static State GetCurrentState ( ) { var digger = GameObject . FindObjectOfType < Digger > ( ) ; var playerLocation = digger . transform . position ; var dist = LevelManager . instance . GetShortestPathDistance ( digger . startX , digger . startY , ( int ) playerLocation . x , ( int ) playerLocation . y ) ; return new State ( ( int ) playerLocation . x , ( int ) playerLocation . y , dist , LevelManager . instance . GetLevel ( ) , digger . availableKeys ) ; }
Gets the current state of the world
Gets the current state of the world
The current state
The current state