예제 #1
0
        public override MyObjectBuilder_EntityBase GetObjectBuilder(bool copy = false)
        {
            var builder = (MyObjectBuilder_FloatingObject)base.GetObjectBuilder(copy);

            builder.Item = Item.GetObjectBuilder();
            return(builder);
        }
예제 #2
0
        private static MyObjectBuilder_Meteor PrepareBuilder(ref MyPhysicalInventoryItem item)
        {
            var meteorBuilder = MyObjectBuilderSerializer.CreateNewObject <MyObjectBuilder_Meteor>();

            meteorBuilder.Item             = item.GetObjectBuilder();
            meteorBuilder.PersistentFlags |= MyPersistentEntityFlags2.Enabled | MyPersistentEntityFlags2.InScene;
            return(meteorBuilder);
        }
예제 #3
0
        private static MyObjectBuilder_FloatingObject PrepareBuilder(ref MyPhysicalInventoryItem item)
        {
            Debug.Assert(item.Amount > 0, "FloatObject item amount must be > 0");

            var floatingBuilder = MyObjectBuilderSerializer.CreateNewObject <MyObjectBuilder_FloatingObject>();

            floatingBuilder.Item             = item.GetObjectBuilder();
            floatingBuilder.PersistentFlags |= MyPersistentEntityFlags2.Enabled | MyPersistentEntityFlags2.InScene;
            return(floatingBuilder);
        }
예제 #4
0
            public override MyObjectBuilder_EntityBase GetObjectBuilder(bool copy = false)
            {
                var builder = (MyObjectBuilder_Meteor)base.GetObjectBuilder(copy);

                builder.LinearVelocity  = Entity.Physics.LinearVelocity;
                builder.AngularVelocity = Entity.Physics.AngularVelocity;
                if (GameLogic != null)
                {
                    builder.Item      = Item.GetObjectBuilder();
                    builder.Integrity = Integrity;
                }
                return(builder);
            }
예제 #5
0
        private static MyObjectBuilder_FloatingObject PrepareBuilder(ref MyPhysicalInventoryItem item)
        {
            MyObjectBuilder_FloatingObject local1 = MyObjectBuilderSerializer.CreateNewObject <MyObjectBuilder_FloatingObject>();

            local1.Item = item.GetObjectBuilder();
            MyPhysicalItemDefinition physicalItemDefinition = MyDefinitionManager.Static.GetPhysicalItemDefinition(item.Content);

            local1.ModelVariant = physicalItemDefinition.HasModelVariants ? MyUtils.GetRandomInt(physicalItemDefinition.Models.Length) : 0;
            MyObjectBuilder_FloatingObject local2 = local1;

            local2.PersistentFlags |= MyPersistentEntityFlags2.InScene | MyPersistentEntityFlags2.Enabled;
            return(local2);
        }
예제 #6
0
        private static MyObjectBuilder_FloatingObject PrepareBuilder(ref MyPhysicalInventoryItem item)
        {
            Debug.Assert(item.Amount > 0, "FloatObject item amount must be > 0");
            Debug.Assert(item.Scale > 0, "FloatObject item scale must be > 0");

            var floatingBuilder = MyObjectBuilderSerializer.CreateNewObject <MyObjectBuilder_FloatingObject>();

            floatingBuilder.Item = item.GetObjectBuilder();

            var itemDefinition = MyDefinitionManager.Static.GetPhysicalItemDefinition(item.Content);

            floatingBuilder.ModelVariant = itemDefinition.HasModelVariants ? MyUtils.GetRandomInt(itemDefinition.Models.Length) : 0;

            floatingBuilder.PersistentFlags |= MyPersistentEntityFlags2.Enabled | MyPersistentEntityFlags2.InScene;
            return(floatingBuilder);
        }
 protected void RemoveOperatingItem(MyPhysicalInventoryItem item, MyFixedPoint amount)
 {
     MyMultiplayer.RaiseEvent(this, x => x.RemoveOperatingItem_Request, item.GetObjectBuilder(), amount, m_lockedByEntityId);
 }
 public void RemoveOperatingItem(MyPhysicalInventoryItem item, MyFixedPoint amount, long senderEntityId)
 {           
     MyMultiplayer.RaiseEvent(this, x => x.RemoveOperatingItem_Request, item.GetObjectBuilder(), amount, senderEntityId);
 }
 public void InsertOperatingItem(MyPhysicalInventoryItem item, long senderEntityId)
 {
     MyMultiplayer.RaiseEvent(this, x => x.InsertOperatingItem_Request, item.GetObjectBuilder(), senderEntityId);
 }
예제 #10
0
 private static MyObjectBuilder_Meteor PrepareBuilder(ref MyPhysicalInventoryItem item)
 {
     var meteorBuilder = MyObjectBuilderSerializer.CreateNewObject<MyObjectBuilder_Meteor>();
     meteorBuilder.Item = item.GetObjectBuilder();
     meteorBuilder.PersistentFlags |= MyPersistentEntityFlags2.Enabled | MyPersistentEntityFlags2.InScene;
     return meteorBuilder;
 }
예제 #11
0
 protected void RemoveOperatingItem(MyPhysicalInventoryItem item, MyFixedPoint amount)
 {
     MyMultiplayer.RaiseEvent(this, x => x.RemoveOperatingItem_Request, item.GetObjectBuilder(), amount, m_lockedByEntityId);
 }
예제 #12
0
 public void RemoveOperatingItem(MyPhysicalInventoryItem item, MyFixedPoint amount, long senderEntityId)
 {
     MyMultiplayer.RaiseEvent(this, x => x.RemoveOperatingItem_Request, item.GetObjectBuilder(), amount, senderEntityId);
 }
예제 #13
0
 public void InsertOperatingItem(MyPhysicalInventoryItem item, long senderEntityId)
 {
     MyMultiplayer.RaiseEvent(this, x => x.InsertOperatingItem_Request, item.GetObjectBuilder(), senderEntityId);
 }