C# syntax error in class.

I am trying to implement a FSM using this example http://www.playmedusa.com/blog/2010/12/10/a-finite-state-machine-in-c-for-unity3d/

Getting a syntax error Unexpected symbol ;’ in class, struct or interface member declaration right after the line

private FiniteStateMachine FSM<VideoWall>;

Code is below:


using UnityEngine;

public enum Locations { goldmine, bar, bank, home };

public class VideoWall : MonoBehaviour {
  private FiniteStateMachine FSM<VideoWall>;
  public Locations  Location = Locations.goldmine;
  public int           GoldCarried = 0;
  public int           MoneyInBank  = 0;
  public int           Thirst = 0;
  public int           Fatigue = 0;

  public void Awake() {
    Debug.Log("Video Wall awakes...");
    FSM = new FiniteStateMachine();
    FSM.Configure(this, Normal.Instance);
  }

  public void ChangeState(FSMState e) {
    FSM.ChangeState(e);
  }

  public void Update() {
    Thirst++;
    FSM.Update();
  }

  public void ChangeLocation(Locations l) {
    Location = l;
  }

  public void AddToGoldCarried(int amount) {
    GoldCarried += amount;
  }

  public void AddToMoneyInBank(int amount ) {
    MoneyInBank += amount;
    GoldCarried = 0;
  }

  public bool RichEnough() {
    return false;
  }

  public bool PocketsFull() {
    bool full = GoldCarried ==  2 ? true : false;
    return full;
  }

  public bool Thirsty() {
    bool thirsty = Thirst == 10 ? true : false;
    return thirsty;
  }

  public void IncreaseFatigue() {
    Fatigue++;
  }
}

I watch quickly your code but it’s probably because you don’t give a type to your FSM declaration and it’s forbidden ( according to me ).

I mean you must say something like this :

private FiniteStateMachine< YourType > FSM;

If I don’t say mistakes :wink: