private KeyValuePair <int, SceneItemDefinition>?ProcessSectionItem(string line) { if (line.StartsWith("end")) { currentSection = IDESection.END; return(null); } string[] toks = line.Split(new char[] { ' ', ',' }, StringSplitOptions.RemoveEmptyEntries); if (toks.Length < 5) { string msg = "Incorrect number of tokens in OBJS/TOBJ section: " + toks.Length.ToString() + "."; Log.Instance.Print(msg, MessageType.Error); throw new LoadingException(msg); } SceneItemDefinition obj = new SceneItemDefinition(); int id = Int32.Parse(toks[0]); obj.Name = toks[1]; obj.TextureFolder = toks[2]; obj.DrawDistance = float.Parse(toks[4]); obj.Flags = (IdeFlags)int.Parse(toks[5]); return(new KeyValuePair <int, SceneItemDefinition>(id, obj)); }
private bool isShadow(SceneItemPlacement obj) { SceneItemDefinition ide = null; if (!objDefinitions.TryGetValue(obj.Id, out ide)) { return(false); } return(((ide.Flags & IdeFlags.Shadows) != IdeFlags.None) && obj.Name.Contains("shad")); }
private KeyValuePair<int, SceneItemDefinition>? ProcessSectionItem(string line) { if (line.StartsWith("end")) { currentSection = IDESection.END; return null; } string[] toks = line.Split(new char[] { ' ', ',' }, StringSplitOptions.RemoveEmptyEntries); if (toks.Length < 5) { string msg = "Incorrect number of tokens in OBJS/TOBJ section: " + toks.Length.ToString() + "."; Log.Instance.Print(msg, MessageType.Error); throw new LoadingException(msg); } SceneItemDefinition obj = new SceneItemDefinition(); int id = Int32.Parse(toks[0]); obj.Name = toks[1]; obj.TextureFolder = toks[2]; obj.DrawDistance = float.Parse(toks[4]); obj.Flags = (IdeFlags)int.Parse(toks[5]); return new KeyValuePair<int, SceneItemDefinition>(id, obj); }