public StarSystem(string name, int seed) : base() { Name = name; Stars = new BindingList <Star>(); Waypoints = new BindingList <Waypoint>(); JumpPoints = new BindingList <JumpPoint>(); SystemContactList = new VerboseBindingList <SystemContact>(); FactionDetectionLists = new BindingList <FactionSystemDetection>(); TaskGroups = new BindingList <TaskGroupTN>(); Populations = new BindingList <Population>(); OrdnanceGroups = new BindingList <OrdnanceGroupTN>(); m_seed = seed; // Subscribe to change events. SystemContactList.ListChanged += SystemContactList_ListChanged; // Create the faciton contact information for each faction. foreach (Faction f in GameState.Instance.Factions) { f.AddNewContactList(this); } }
public StarSystem(string name, int seed) : base() { Name = name; Stars = new BindingList<Star>(); Waypoints = new BindingList<Waypoint>(); JumpPoints = new BindingList<JumpPoint>(); SystemContactList = new VerboseBindingList<SystemContact>(); FactionDetectionLists = new BindingList<FactionSystemDetection>(); TaskGroups = new BindingList<TaskGroupTN>(); Populations = new BindingList<Population>(); OrdnanceGroups = new BindingList<OrdnanceGroupTN>(); m_seed = seed; // Subscribe to change events. SystemContactList.ListChanged += SystemContactList_ListChanged; // Create the faciton contact information for each faction. foreach (Faction f in GameState.Instance.Factions) { f.AddNewContactList(this); } }
private void SystemContactList_ListChanging(object sender, ListChangingEventArgs e) { VerboseBindingList <SystemContact> list = sender as VerboseBindingList <SystemContact>; switch (e.ListChangedType) { case ListChangedType.ItemAdded: AddContactElement(SceenDefaultEffect, e.ChangingObject as SystemContact); break; case ListChangedType.ItemDeleted: RemoveContactElement(SceenDefaultEffect, e.ChangingObject as SystemContact); break; } }
public StarSystem(string name) { Id = Guid.NewGuid(); Name = name; Stars = new BindingList <Star>(); Waypoints = new BindingList <Waypoint>(); JumpPoints = new BindingList <JumpPoint>(); SystemContactList = new VerboseBindingList <SystemContact>(); FactionDetectionLists = new BindingList <FactionSystemDetection>(); TaskGroups = new BindingList <TaskGroupTN>(); Populations = new BindingList <Population>(); OrdnanceGroups = new BindingList <OrdnanceGroupTN>(); // Subscribe to change events. SystemContactList.ListChanged += SystemContactList_ListChanged; TaskGroups.ListChanged += ContactsChanged; Populations.ListChanged += ContactsChanged; OrdnanceGroups.ListChanged += ContactsChanged; }