public EntityState(int numStates) { this.numStates = numStates; states = new State[numStates]; currentState = states[0]; }
/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { // TODO: Add your initialization logic here orfeo = new MainCharacter(); caronte = new Character(); p1 = new Passage(firstCP, caronteEntityState, 2); p1.addLine(new Line(orfeo, "Parla orfeo"), 0); p1.addLine(new Line(caronte, "parla caronte"), 1); p2 = new Passage(null, caronteEntityState, 0); firstCP = new ChoosePassage(2); firstCP.addPassage(p1,0); firstCP.addLine(new Line(orfeo, "parla di qualcosa"), 0); firstCP.addPassage(p2, 1); firstCP.addLine(new Line(orfeo, "esci dal dialogo"), 1); caronteDialogue = new Dialogue(firstCP); caronteState = new State(); caronteState.lineLookAt = new Line(caronte, "caronte -> lookat"); caronteState.linePickUp = new Line(caronte, "caronte -> pickup"); caronteState.dialogue = caronteDialogue; caronteEntityState = new EntityState(1); caronteEntityState.states[0] = caronteState; caronteEntityState.currentState = caronteState; caronte.entityState = caronteEntityState; base.Initialize(); }