public override bool execute(Characters.Player player) { if (this.hasSecondWord()) { try { int values = Convert.ToInt32(this.secondWord); TextReader logs = new StreamReader("PathLog.txt"); ArrayList temp = new ArrayList(); foreach (var i in logs.ReadLine()) { temp.Add(i); } if (values > temp.Count) { values = temp.Count; } for (int i = values; i > 0; i--) { var x = temp[i]; if (x == "west") { x = "east"; } else if (x == "east") { x = "west"; } else if (x == "north") { x = "south"; } else if (x == "south") { x = "north"; } Command command = "go" + (string)x; //parser.parseCommand(Console.ReadLine()); temp.RemoveAt(i); } player.outputMessage("\nI cannot backup " + this.secondWord); } catch { Console.WriteLine("Your not aloud to do that please continue"); } } else { player.outputMessage("\n How far to return to the past?"); } return(false); }
public override bool execute(Characters.Player player) { if (this.hasSecondWord()) { player.outputMessage("\n >.< You tried, but wasn't able to find it" + this.secondWord); } else { player.outputMessage("\n You wheren't able to find anything"); } return(false); }
public override bool execute(Characters.Player player) { if (this.hasSecondWord()) { player.outputMessage("\nKeep calm and carry on" + this.secondWord); } return(false); }
public override bool execute(Characters.Player player) { if (this.hasSecondWord()) { player.outputMessage("\nI cannot quit " + this.secondWord); } return(false); }
public bool execute(Characters.Player player) { bool answer = true; if (this.hasThirdWord()) { player.outputMessage("\nI cannot quit " + this.secondWord + ' ' + this.thirdWord); answer = false; } else if (this.hasSecondWord()) { player.outputMessage("\nI cannot quit " + this.secondWord); answer = false; } return(answer); // if the bool = true the program quits }
public override bool execute(Characters.Player player) { if (this.hasSecondWord()) { player.outputMessage("\n>.< wasn't able to find it" + this.secondWord); } return(false); }
public bool execute(Characters.Player player) { if (this.hasSecondWord()) { player.waltTo(this.secondWord); string[] X = new string[1]; X[0] = this.secondWord; File.AppendAllLines("PathLog.txt", X); } else { player.outputMessage("\nGo Where?"); } return(false); }