Example #1
0
 // get a puzzle object id given name
 public int GetObjectId(string name)
 {
     return(Enumerable.Range(1, GameDef.ObjectCount)
            .FirstOrDefault(x => GameDef.GetObject(x).Name
                            .Equals(name, StringComparison.InvariantCultureIgnoreCase))); // 0 if not found
 }
Example #2
0
        // get a puzzle object, which may have been updated
        public PuzzleObject GetObject(int objid)
        {
            var obj = _states.Last().PuzzleObjects.SafeLookup(objid);

            return(obj ?? GameDef.GetObject(objid));
        }