Esempio n. 1
0
        private static void OnAttach(MySyncMotorBase block, ref AttachMsg msg, MyNetworkClient sender)
        {
            MyMotorBase stator      = (MyMotorBase)block.Entity;
            MyEntity    rotorEntity = null;

            if (!MyEntities.TryGetEntityById(msg.AttachableEntityId, out rotorEntity))
            {
                Debug.Assert(false, "Could not find rotor entity to attach to stator");
                return;
            }
            MyMotorRotor rotor = (MyMotorRotor)rotorEntity;

            Debug.Assert(stator.CubeGrid != rotor.CubeGrid, "Trying to attach rotor to stator on the same grid");

            stator.Attach(rotor);
        }
Esempio n. 2
0
 public MySyncMotorBase(MyMotorBase stator)
     : base(stator)
 {
 }
 public MyDebugRenderComponentMotorBase(MyMotorBase motor) : base(motor)
 {
     m_motor = motor;
 }