public override void InitFromDefinition(MySessionComponentDefinition definition) { base.InitFromDefinition(definition); if (MyMultiplayer.Static != null && !MyMultiplayer.Static.IsServer) { MyMultiplayer.RaiseStaticEvent(x => RequestCurrentState); } else { var def = definition as MySessionComponentResearchDefinition; if (def == null) { return; } WhitelistMode = def.WhitelistMode; foreach (var id in def.Researches) { var researchDef = MyDefinitionManager.Static.GetDefinition <MyResearchDefinition>(id); foreach (var defId in researchDef.Entries) { m_requiredResearch.Add(defId); } } } }
public override void InitFromDefinition(MySessionComponentDefinition definition) { base.InitFromDefinition(definition); m_cubeBuilderDefinition = definition as MyCubeBuilderDefinition; MyCubeBuilderDefinition cubeBuilderDefinition = m_cubeBuilderDefinition; IntersectionDistance = m_cubeBuilderDefinition.DefaultBlockBuildingDistance; }
public override void InitFromDefinition(MySessionComponentDefinition definition) { base.InitFromDefinition(definition); var def = (MyDemoComponentDefinition)definition; Debug.Print("Values from definition:"); Debug.Print("Int: {0}", def.Int); Debug.Print("Float: {0}", def.Float); Debug.Print("String: {0}", def.String); }
public override void InitFromDefinition(MySessionComponentDefinition definition) { base.InitFromDefinition(definition); m_cubeBuilderDefinition = definition as MyCubeBuilderDefinition; if (m_cubeBuilderDefinition == null) { Debug.Fail("This should not happen, please check"); } IntersectionDistance = m_cubeBuilderDefinition.DefaultBlockBuildingDistance; }
public override void InitFromDefinition(MySessionComponentDefinition definition) { base.InitFromDefinition(definition); MyClipboardDefinition clipboardDefinition = definition as MyClipboardDefinition; if (clipboardDefinition == null) { Debug.Fail("Wrong definition! Please check."); } m_definition = clipboardDefinition; m_clipboard = new MyGridClipboard(m_definition.PastingSettings, calculateVelocity: true); }
public override void InitFromDefinition(MySessionComponentDefinition definition) { base.InitFromDefinition(definition); MyCoordinateSystemDefinition coordSysDef = definition as MyCoordinateSystemDefinition; if (coordSysDef == null) { Debug.Fail("Wrong definition, something is very wrong. Check SessionComponent.sbc"); } this.m_coorsSystemSize = coordSysDef.CoordSystemSize; this.m_angleTolerance = coordSysDef.AngleTolerance; this.m_positionTolerance = coordSysDef.PositionTolerance; }
public override void InitFromDefinition(MySessionComponentDefinition definition) { base.InitFromDefinition(definition); var def = definition as MySessionComponentResearchDefinition; if (def == null) return; foreach (var id in def.Researches) { var researchDef = MyDefinitionManager.Static.GetDefinition<MyResearchDefinition>(id); foreach (var defId in researchDef.Entries) m_requiredResearch.Add(defId); } }
public override void InitFromDefinition(MySessionComponentDefinition definition) { base.InitFromDefinition(definition); var def = definition as MySessionComponentResearchDefinition; if (def == null) { return; } foreach (var id in def.Researches) { var researchDef = MyDefinitionManager.Static.GetDefinition <MyResearchDefinition>(id); foreach (var defId in researchDef.Entries) { m_requiredResearch.Add(defId); } } }
public override void InitFromDefinition(MySessionComponentDefinition definition) { base.InitFromDefinition(definition); MyClipboardDefinition clipboardDefinition = definition as MyClipboardDefinition; if (clipboardDefinition == null) Debug.Fail("Wrong definition! Please check."); m_definition = clipboardDefinition; m_clipboard = new MyGridClipboard(m_definition.PastingSettings, calculateVelocity: true); }
public virtual void InitFromDefinition(MySessionComponentDefinition definition) { }
public override void InitFromDefinition(MySessionComponentDefinition definition) { base.InitFromDefinition(definition); }
public override void InitFromDefinition(MySessionComponentDefinition definition) { base.InitFromDefinition(definition); if (MyMultiplayer.Static != null && !MyMultiplayer.Static.IsServer) { MyMultiplayer.RaiseStaticEvent(x => RequestCurrentState); } else { var def = definition as MySessionComponentResearchDefinition; if (def == null) return; WhitelistMode = def.WhitelistMode; foreach (var id in def.Researches) { var researchDef = MyDefinitionManager.Static.GetDefinition<MyResearchDefinition>(id); foreach (var defId in researchDef.Entries) m_requiredResearch.Add(defId); } } }