public int AddCellTrigger(CPos[] cells, Action <Actor> onEntry, Action <Actor> onExit) { var id = nextTriggerId++; var t = new CellTrigger(cells, onEntry, onExit); cellTriggers.Add(id, t); var layer = influence[0]; foreach (var c in cells) { if (!layer.Contains(c)) { continue; } if (!cellTriggerInfluence.ContainsKey(c)) { cellTriggerInfluence.Add(c, new List <CellTrigger>()); } cellTriggerInfluence[c].Add(t); } return(id); }
public void UnSpawnSpaces() { foreach (Map current in this.m_maps.Values) { InteractiveObject[] array = current.GetInteractiveObjects().ToArray <InteractiveObject>(); InteractiveObject[] array2 = array; for (int i = 0; i < array2.Length; i++) { InteractiveObject interactive = array2[i]; current.UnSpawnInteractive(interactive); } SpawningPoolBase[] array3 = current.SpawningPools.ToArray <SpawningPoolBase>(); for (int i = 0; i < array3.Length; i++) { SpawningPoolBase spawningPool = array3[i]; current.RemoveSpawningPool(spawningPool); } CellTrigger[] array4 = current.GetTriggers().ToArray <CellTrigger>(); CellTrigger[] array5 = array4; for (int i = 0; i < array5.Length; i++) { CellTrigger trigger = array5[i]; current.RemoveTrigger(trigger); } } foreach (System.Collections.Generic.KeyValuePair <int, SubArea> current2 in this.m_subAreas) { foreach (MonsterSpawn current3 in current2.Value.MonsterSpawns) { current2.Value.RemoveMonsterSpawn(current3); } } }
private void SetCellTrigger(Point location) { if (map.Metrics.GetCell(location, out int cell)) { if (map.CellTriggers[cell] == null) { if (!undoCellTriggers.ContainsKey(cell)) { undoCellTriggers[cell] = map.CellTriggers[cell]; } var cellTrigger = new CellTrigger { Trigger = triggerCombo.SelectedItem as string }; map.CellTriggers[cell] = cellTrigger; redoCellTriggers[cell] = cellTrigger; mapPanel.Invalidate(); plugin.Dirty = true; } } }
public int AddCellTrigger(CPos[] cells, Action<Actor> onEntry, Action<Actor> onExit) { var id = nextTriggerId++; var t = new CellTrigger(id, cells, onEntry, onExit); cellTriggers.Add(id, t); foreach (var c in cells) { if (!map.Contains(c)) continue; if (!cellTriggerInfluence.ContainsKey(c)) cellTriggerInfluence.Add(c, new List<CellTrigger>()); cellTriggerInfluence[c].Add(t); } return id; }