public void SetPortal(MCMloPortalDef portal) { CurrentPortal = portal; Tag = portal; UpdateFormTitle(); MloInstanceData instance = ProjectForm.TryGetMloInstance(portal?.OwnerMlo); //ProjectForm.WorldForm?.SelectMloPortal(portal, instance); UpdateControls(); }
public void LoadChildren(Meta meta) { var centities = MetaTypes.ConvertDataArray <CEntityDef>(meta, MetaName.CEntityDef, _MloArchetypeDefData.entities); if (centities != null) { entities = new MCEntityDef[centities.Length]; for (int i = 0; i < centities.Length; i++) { entities[i] = new MCEntityDef(meta, ref centities[i]) { Archetype = this }; } } var crooms = MetaTypes.ConvertDataArray <CMloRoomDef>(meta, MetaName.CMloRoomDef, _MloArchetypeDefData.rooms); if (crooms != null) { rooms = new MCMloRoomDef[crooms.Length]; for (int i = 0; i < crooms.Length; i++) { rooms[i] = new MCMloRoomDef(meta, crooms[i]) { Archetype = this, Index = i }; } } var cportals = MetaTypes.ConvertDataArray <CMloPortalDef>(meta, MetaName.CMloPortalDef, _MloArchetypeDefData.portals); if (cportals != null) { portals = new MCMloPortalDef[cportals.Length]; for (int i = 0; i < cportals.Length; i++) { portals[i] = new MCMloPortalDef(meta, cportals[i]); } } var centitySets = MetaTypes.ConvertDataArray <CMloEntitySet>(meta, MetaName.CMloEntitySet, _MloArchetypeDefData.entitySets); if (centitySets != null) { entitySets = new MCMloEntitySet[centitySets.Length]; for (int i = 0; i < centitySets.Length; i++) { entitySets[i] = new MCMloEntitySet(meta, centitySets[i]); } } timeCycleModifiers = MetaTypes.ConvertDataArray <CMloTimeCycleModifier>(meta, MetaName.CMloTimeCycleModifier, _MloArchetypeDefData.timeCycleModifiers); }
public void AddPortal(MCMloPortalDef portal) { if (portal == null) { return; } portal.OwnerMlo = this; portal.Index = portals?.Length ?? 0; var newportals = portals?.ToList() ?? new List <MCMloPortalDef>(); newportals.Add(portal); portals = newportals.ToArray(); }
public void RemovePortal(MCMloPortalDef portal) { if (portal == null) { return; } var newportals = portals.ToList(); newportals.Remove(portal); portals = newportals.ToArray(); for (int i = 0; i < portals.Length; i++) { portals[i].Index = i; } }