/// <summary> /// This method will find and return a Thing that represents the class thing. /// Exact class name is not needed /// </summary> /// <param name="idClassThing"></param> /// <returns></returns> public Thing FindThingByClass(string idClassThing) { IEnumerator gameThings = InGame.inGame.GetGameThingEnumerator(); while (gameThings.MoveNext()) { Boku.Base.GameThing gameThing = gameThings.Current as Boku.Base.GameThing; if (gameThing.GetType().Name.Contains(idClassThing)) { return(new Thing(gameThing)); } } return(null); }
/// <summary> /// This method will fine and return a Thing that represents the instance of a GameThing. /// The id of the instance can only be set today by modifying the saved game�s stuff /// file and adding the id property. /// </summary> /// <param name="idThing"></param> /// <returns></returns> public Thing FindThingById(string idThing) { IEnumerator gameThings = InGame.inGame.GetGameThingEnumerator(); while (gameThings.MoveNext()) { Boku.Base.GameThing gameThing = gameThings.Current as Boku.Base.GameThing; if (gameThing.id == idThing) { return(new Thing(gameThing)); } } return(null); }
public Thing(Boku.Base.GameThing gameThing) { this.gameThing = gameThing; }