public KeyValuePair <string, NounObject>?FindObject(NounObject input, out bool isInInventory, bool includeInventory = false) { if (includeInventory) { foreach (var nounObject in _gameState.inventory.objMap) { if (nounObject.Value.myKey == input.myKey) { isInInventory = true; return(nounObject); } } } else { isInInventory = false; foreach (var nounObject in _gameState.currentRoom().allNounsInScene) { if (nounObject.Value.myKey == input.myKey) { return(nounObject); } } } isInInventory = false; return(null); }
public void AddItem(string name, NounObject obj) { objMap.Add(name, obj); }
public Room RegisterNounInScene(string name, NounObject obj) { allNounsInScene.Add(name, obj); obj.myKey = name; return(this); }
public Room AddNounChild(string name, string objname, NounObject obj) { Children[name].nounChildren.Add(objname, obj); RegisterNounInScene(objname, obj); return(this); }
public Room AddNoun(string name, NounObject obj) { Children.Add(name, obj); RegisterNounInScene(name, obj); return(this); }
public void RemoveObject(NounObject input) { bool isinInv; RemoveObject(FindObject(input, out isinInv, true).Value.Key); }