private void Change(VisClass.Rep.Setting setting) { if (!setting.isInherited) { int num = 0; while (num < (int)this.klass.keys.Length) { if (this.klass.keys[num] != setting.name) { num++; } else { this.klass.values[num] = setting.query; break; } } } else { VisQuery visQuery = setting.valueSet; Dictionary <string, VisClass.Rep.Setting> strs = this.dict; string str = setting.name; VisClass.Rep.Setting setting1 = setting.Override(this.klass); setting = setting1; strs[str] = setting1; setting.isInherited = false; setting.valueSet = visQuery; Array.Resize <string>(ref this.klass.keys, (int)this.klass.keys.Length + 1); Array.Resize <VisQuery>(ref this.klass.values, (int)this.klass.values.Length + 1); this.klass.keys[(int)this.klass.keys.Length - 1] = setting.name; this.klass.values[(int)this.klass.values.Length - 1] = visQuery; } }
private void Change(Setting setting) { if (setting.isInherited) { VisQuery valueSet = setting.valueSet; this.dict[setting.name] = setting = setting.Override(this.klass); setting.isInherited = false; setting.valueSet = valueSet; Array.Resize <string>(ref this.klass.keys, this.klass.keys.Length + 1); Array.Resize <VisQuery>(ref this.klass.values, this.klass.values.Length + 1); this.klass.keys[this.klass.keys.Length - 1] = setting.name; this.klass.values[this.klass.values.Length - 1] = valueSet; } else { for (int i = 0; i < this.klass.keys.Length; i++) { if (this.klass.keys[i] == setting.name) { this.klass.values[i] = setting.query; break; } } } }
internal Instance(VisQuery outer, ref int bit) { this.outer = outer; this.applicable = new HSet <VisNode>(); this.bit = ((int)1) << bit; this.bitNumber = (byte)bit; bit++; }
internal Instance(VisQuery outer, ref int bit) { this.outer = outer; this.applicable = new HSet <VisNode>(); this.bit = (long)(1 << (bit & 31)); this.bitNumber = (byte)bit; bit = bit + 1; }
public void EditorOnly_Add(ref VisClass.Rep rep, string key, VisQuery value) { Array.Resize <string>(ref this.keys, (int)this.keys.Length + 1); Array.Resize <VisQuery>(ref this.values, (int)this.values.Length + 1); this.keys[(int)this.keys.Length - 1] = key; this.values[(int)this.values.Length - 1] = value; rep = null; }
public void EditorOnly_Add(ref VisClass.Rep rep, string key, VisQuery value) { Array.Resize<string>(ref this.keys, (int)this.keys.Length + 1); Array.Resize<VisQuery>(ref this.values, (int)this.values.Length + 1); this.keys[(int)this.keys.Length - 1] = key; this.values[(int)this.values.Length - 1] = value; rep = null; }
internal static void Recur(ref VisClass.Rep rep, VisClass klass) { if (klass._super != null) { Recur(ref rep, klass._super); foreach (Setting setting in rep.dict.Values) { setting.isInherited = true; } for (int i = 0; i < klass.keys.Length; i++) { string str = klass.keys[i]; if (!string.IsNullOrEmpty(str)) { Setting setting2; VisQuery query = klass.values[i]; if (!rep.dict.TryGetValue(str, out setting2)) { if (query == null) { continue; } setting2 = new Setting(str, klass, rep); rep.dict.Add(str, setting2); } else { rep.dict[str] = setting2 = setting2.Override(klass); } setting2.isInherited = false; setting2.query = query; } } } else { rep = new VisClass.Rep(); rep.klass = nklass; rep.dict = new Dictionary <string, Setting>(); for (int j = 0; j < klass.keys.Length; j++) { string str2 = klass.keys[j]; if (!string.IsNullOrEmpty(str2)) { VisQuery query2 = klass.values[j]; if (query2 != null) { Setting setting3 = new Setting(str2, klass, rep) { query = query2 }; rep.dict.Add(str2, setting3); } } } } }
internal static void Recur(ref VisClass.Rep rep, VisClass klass) { VisClass.Rep.Setting setting; if (!klass._super) { rep = new VisClass.Rep() { klass = VisClass.Rep.nklass, dict = new Dictionary <string, VisClass.Rep.Setting>() }; for (int i = 0; i < (int)klass.keys.Length; i++) { string str = klass.keys[i]; if (!string.IsNullOrEmpty(str)) { VisQuery visQuery = klass.values[i]; if (visQuery != null) { VisClass.Rep.Setting setting1 = new VisClass.Rep.Setting(str, klass, rep) { query = visQuery }; rep.dict.Add(str, setting1); } } } } else { VisClass.Rep.Recur(ref rep, klass._super); foreach (VisClass.Rep.Setting value in rep.dict.Values) { value.isInherited = true; } for (int j = 0; j < (int)klass.keys.Length; j++) { string str1 = klass.keys[j]; if (!string.IsNullOrEmpty(str1)) { VisQuery visQuery1 = klass.values[j]; if (rep.dict.TryGetValue(str1, out setting)) { Dictionary <string, VisClass.Rep.Setting> strs = rep.dict; VisClass.Rep.Setting setting2 = setting.Override(klass); setting = setting2; strs[str1] = setting2; } else { if (visQuery1 == null) { goto Label0; } setting = new VisClass.Rep.Setting(str1, klass, rep); rep.dict.Add(str1, setting); } setting.isInherited = false; setting.query = visQuery1; } Label0: } } }
private void Setup() { int num; if (this.locked) { return; } if (this.recurseLock) { Debug.LogError("Recursion in setup hit itself, some VisClass has super set to something which references itself", this); return; } this.recurseLock = true; List <VisQuery> visQueries = new List <VisQuery>(); HashSet <VisQuery> visQueries1 = new HashSet <VisQuery>(); Dictionary <string, VisQuery> strs = new Dictionary <string, VisQuery>(); if (!this._super) { for (int i = 0; i < (int)this.keys.Length; i++) { string str = this.keys[i]; if (!string.IsNullOrEmpty(str)) { VisQuery visQuery = this.values[i]; if (visQuery != null) { strs.Add(str, visQuery); if (visQueries1.Add(visQuery)) { visQueries.Add(visQuery); } } } } } else { this._super.Setup(); if (this.keys != null) { for (int j = 0; j < (int)this.keys.Length; j++) { string str1 = this.keys[j]; if (!string.IsNullOrEmpty(str1)) { VisQuery visQuery1 = this.values[j]; if (this._super.members.TryGetValue(str1, out num)) { VisQuery visQuery2 = this._super.instance[num]; if (visQuery2 == visQuery1) { if (visQuery2 != null) { visQueries1.Add(visQuery2); strs.Add(str1, visQuery2); } } else if (visQuery1 != null) { strs.Add(str1, visQuery1); visQueries1.Add(visQuery1); } } else if (visQuery1 != null) { strs.Add(str1, visQuery1); visQueries1.Add(visQuery1); } } } } this.BuildMembers(visQueries, visQueries1); } this.members = new Dictionary <string, int>(strs.Count); foreach (KeyValuePair <string, VisQuery> keyValuePair in strs) { this.members.Add(keyValuePair.Key, visQueries.IndexOf(keyValuePair.Value)); } this.instance = visQueries.ToArray(); this.recurseLock = false; this.locked = true; }
private void Setup() { if (!this.locked) { if (this.recurseLock) { Debug.LogError("Recursion in setup hit itself, some VisClass has super set to something which references itself", this); } else { this.recurseLock = true; System.Collections.Generic.List <VisQuery> list = new System.Collections.Generic.List <VisQuery>(); HashSet <VisQuery> hset = new HashSet <VisQuery>(); Dictionary <string, VisQuery> dictionary = new Dictionary <string, VisQuery>(); if (this._super != null) { this._super.Setup(); if (this.keys != null) { for (int i = 0; i < this.keys.Length; i++) { string str = this.keys[i]; if (!string.IsNullOrEmpty(str)) { int num2; VisQuery query = this.values[i]; if (this._super.members.TryGetValue(str, out num2)) { VisQuery item = this._super.instance[num2]; if (item == query) { if (item != null) { hset.Add(item); dictionary.Add(str, item); } } else if (query != null) { dictionary.Add(str, query); hset.Add(query); } } else if (query != null) { dictionary.Add(str, query); hset.Add(query); } } } } this.BuildMembers(list, hset); } else { for (int j = 0; j < this.keys.Length; j++) { string str2 = this.keys[j]; if (!string.IsNullOrEmpty(str2)) { VisQuery query3 = this.values[j]; if (query3 != null) { dictionary.Add(str2, query3); if (hset.Add(query3)) { list.Add(query3); } } } } } this.members = new Dictionary <string, int>(dictionary.Count); foreach (KeyValuePair <string, VisQuery> pair in dictionary) { this.members.Add(pair.Key, list.IndexOf(pair.Value)); } this.instance = list.ToArray(); this.recurseLock = false; this.locked = true; } } }
public void Execute(VisQuery.TryResult res, VisNode self, VisNode other) { switch (res) { case VisQuery.TryResult.Enter: { this.ExecuteEnter(self, other); break; } case VisQuery.TryResult.Stay: { break; } case VisQuery.TryResult.Exit: { this.ExecuteExit(self, other); break; } default: { goto case VisQuery.TryResult.Stay; } } }
internal Instance(VisQuery outer, ref int bit) { this.outer = outer; this.applicable = new HSet<VisNode>(); this.bit = (long)(1 << (bit & 31)); this.bitNumber = (byte)bit; bit = bit + 1; }