当前位置: 首页>>代码示例>>C#>>正文


C# Definitions.MyBlueprintDefinitionBase类代码示例

本文整理汇总了C#中Sandbox.Definitions.MyBlueprintDefinitionBase的典型用法代码示例。如果您正苦于以下问题:C# MyBlueprintDefinitionBase类的具体用法?C# MyBlueprintDefinitionBase怎么用?C# MyBlueprintDefinitionBase使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


MyBlueprintDefinitionBase类属于Sandbox.Definitions命名空间,在下文中一共展示了MyBlueprintDefinitionBase类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: MyRepairBlueprintToProduce

 public MyRepairBlueprintToProduce(MyFixedPoint amount, MyBlueprintDefinitionBase blueprint, uint inventoryItemId, MyObjectBuilderType inventoryItemType, MyStringHash inventoryItemSubtypeId) : base(amount, blueprint)
 {
     System.Diagnostics.Debug.Assert(Blueprint is MyRepairBlueprintDefinition, "MyRepairBlueprintToProduce class should be used together with blueprints type of MyRepairBlueprintDefinition only!");
     InventoryItemId = inventoryItemId;
     InventoryItemType = inventoryItemType;
     InventoryItemSubtypeId = inventoryItemSubtypeId;
 }
开发者ID:2asoft,项目名称:SpaceEngineers,代码行数:7,代码来源:MyCraftingComponentBase.cs

示例2: PostprocessAddSubblueprint

        private void PostprocessAddSubblueprint(MyBlueprintDefinitionBase blueprint, MyFixedPoint blueprintAmount)
        {
            for (int i = 0; i < blueprint.Prerequisites.Length; ++i)
            {
                Item prerequisite = blueprint.Prerequisites[i];
                prerequisite.Amount *= blueprintAmount;
                AddToItemList(m_tmpPrerequisiteList, prerequisite);
            }

            for (int i = 0; i < blueprint.Results.Length; ++i)
            {
                Item result = blueprint.Results[i];
                result.Amount *= blueprintAmount;
                AddToItemList(m_tmpResultList, result);
            }
        }
开发者ID:fluxit,项目名称:SpaceEngineers,代码行数:16,代码来源:MyCompositeBlueprintDefinition.cs

示例3: InsertQueueItemRequest

 public void InsertQueueItemRequest(int idx, MyBlueprintDefinitionBase blueprint, MyFixedPoint amount)
 {
     if (MyFakes.ENABLE_PRODUCTION_SYNC)
     {
         if (Sync.IsServer)
         {
             InsertQueueItem(idx, blueprint, amount);
             SyncObject.AddQueueItemAnnounce(blueprint, amount, idx);
         }
         else
             SyncObject.AddQueueItemRequest(blueprint, amount, idx);
     }
     else
     {
         InsertQueueItem(idx, blueprint, amount);
     }
 }
开发者ID:Krulac,项目名称:SpaceEngineers,代码行数:17,代码来源:MyProductionBlock.cs

示例4: InsertQueueItem

 protected override void InsertQueueItem(int idx, MyBlueprintDefinitionBase blueprint, MyFixedPoint amount)
 {
     if (idx == 0)
     {
         var queueItem = TryGetFirstQueueItem();
         if (queueItem.HasValue && queueItem.Value.Blueprint != blueprint)
             CurrentProgress = 0f;
     }
     base.InsertQueueItem(idx, blueprint, amount);
 }
开发者ID:notten,项目名称:SpaceEngineers,代码行数:10,代码来源:MyAssembler.cs

示例5: CheckInventoryContents

 private bool CheckInventoryContents(MyInventory inventory, MyBlueprintDefinitionBase.Item item, MyFixedPoint amountMultiplier)
 {
     return inventory.ContainItems(item.Amount * amountMultiplier, item.Id);
 }
开发者ID:notten,项目名称:SpaceEngineers,代码行数:4,代码来源:MyAssembler.cs

示例6: CheckInventoryCapacity

 private bool CheckInventoryCapacity(MyInventory inventory, MyBlueprintDefinitionBase.Item item, MyFixedPoint amountMultiplier)
 {
     return inventory.CanItemsBeAdded(item.Amount * amountMultiplier, item.Id);
 }
开发者ID:notten,项目名称:SpaceEngineers,代码行数:4,代码来源:MyAssembler.cs

示例7: FinishDisassembling

        private void FinishDisassembling(MyBlueprintDefinitionBase blueprint)
        {
            if (RepeatEnabled && Sync.IsServer) OutputInventory.ContentsChanged -= OutputInventory_ContentsChanged;
            foreach (var res in blueprint.Results)
            {
                OutputInventory.RemoveItemsOfType(res.Amount, res.Id);
            }
            if (RepeatEnabled && Sync.IsServer) OutputInventory.ContentsChanged += OutputInventory_ContentsChanged;

            var amountMult = (MyFixedPoint)(1.0f / MySession.Static.AssemblerEfficiencyMultiplier);
            for (int i = 0; i < blueprint.Prerequisites.Length; ++i)
            {
                var item = blueprint.Prerequisites[i];
                var itemOb = (MyObjectBuilder_PhysicalObject)MyObjectBuilderSerializer.CreateNewObject(item.Id.TypeId, item.Id.SubtypeName);
                InputInventory.AddItems(item.Amount * amountMult, itemOb);
            }
        }
开发者ID:notten,项目名称:SpaceEngineers,代码行数:17,代码来源:MyAssembler.cs

示例8: calculateBlueprintProductionTime

 private float calculateBlueprintProductionTime(MyBlueprintDefinitionBase currentBlueprint)
 {
     return currentBlueprint.BaseProductionTimeInSeconds * 1000 / (MySession.Static.AssemblerSpeedMultiplier * ((MyAssemblerDefinition)BlockDefinition).AssemblySpeed + UpgradeValues["Productivity"]);
 }
开发者ID:notten,项目名称:SpaceEngineers,代码行数:4,代码来源:MyAssembler.cs

示例9: RemoveItemToProduce

 public void RemoveItemToProduce(MyFixedPoint amount, MyBlueprintDefinitionBase blueprint, long senderEntityId, int itemId = -1)
 {        
     SerializableDefinitionId blueprintId = blueprint.Id;
     MyMultiplayer.RaiseEvent(this, x => x.RemoveItemToProduce_Request, amount, blueprintId, senderEntityId, itemId);
 }
开发者ID:2asoft,项目名称:SpaceEngineers,代码行数:5,代码来源:MyCraftingComponentBase.cs

示例10: AddItemToRepair

 public void AddItemToRepair(MyFixedPoint amount, MyBlueprintDefinitionBase blueprint, long senderEntityId, uint inventoryItemId, MyObjectBuilderType inventoryItemType, MyStringHash inventoryItemSubtypeId)
 {
     SerializableDefinitionId blueprintId = blueprint.Id;
     MyMultiplayer.RaiseEvent(this, x => x.AddItemToRepair_Request, amount, blueprintId, senderEntityId, inventoryItemId, inventoryItemType, inventoryItemSubtypeId);
 }
开发者ID:2asoft,项目名称:SpaceEngineers,代码行数:5,代码来源:MyCraftingComponentBase.cs

示例11: CanUseBlueprint

        public bool CanUseBlueprint(MyBlueprintDefinitionBase blueprint)
        {
            System.Diagnostics.Debug.Assert(blueprint != null, "Passing blueprint as null argument!");

            foreach (var blueprintClass in m_blueprintClasses)
                if (blueprintClass.ContainsBlueprint(blueprint)) return true;

            return false;
        }
开发者ID:2asoft,项目名称:SpaceEngineers,代码行数:9,代码来源:MyCraftingComponentBase.cs

示例12: MyBlueprintToProduce

 public MyBlueprintToProduce(MyFixedPoint amount, MyBlueprintDefinitionBase blueprint)
 {
     Amount = amount;
     Blueprint = blueprint;
 }
开发者ID:2asoft,项目名称:SpaceEngineers,代码行数:5,代码来源:MyCraftingComponentBase.cs

示例13: OnBlueprintProduced

 protected void OnBlueprintProduced(MyBlueprintDefinitionBase blueprint, MyFixedPoint amount)
 {
     SerializableDefinitionId blueprintId = blueprint.Id;
     MyMultiplayer.RaiseEvent(this, x => x.OnBlueprintProduced_Implementation, blueprintId, amount);   
 }
开发者ID:2asoft,项目名称:SpaceEngineers,代码行数:5,代码来源:MyCraftingComponentBase.cs

示例14: RaiseEvent_MissingRequiredItem

 protected void RaiseEvent_MissingRequiredItem(MyBlueprintDefinitionBase blueprint, MyBlueprintDefinitionBase.Item missingItem)
 {
     MyMultiplayer.RaiseEvent(this, x => x.MissingRequiredItem_Implementation, (SerializableDefinitionId)blueprint.Id, (SerializableDefinitionId)missingItem.Id);
 }
开发者ID:2asoft,项目名称:SpaceEngineers,代码行数:4,代码来源:MyCraftingComponentBase.cs

示例15: InsertQueueItem

        protected virtual void InsertQueueItem(int idx, MyBlueprintDefinitionBase blueprint, MyFixedPoint amount)
        {
            Debug.Assert(idx <= m_queue.Count);
            Debug.Assert(CanUseBlueprint(blueprint));
            Debug.Assert(amount > 0);

            QueueItem item = new QueueItem();
            item.Amount = amount;
            item.Blueprint = blueprint;

            if (CanUseBlueprint(item.Blueprint))
            {
                if (m_queue.IsValidIndex(idx) && m_queue[idx].Blueprint == item.Blueprint)
                {
                    // Increase amount if there is same kind of item at this index.
                    item.Amount += m_queue[idx].Amount;
                    item.ItemId = m_queue[idx].ItemId;
                    m_queue[idx] = item;
                }
                else if (m_queue.Count > 0 && (idx >= m_queue.Count || idx == -1) && m_queue[m_queue.Count - 1].Blueprint == item.Blueprint)
                {
                    // Add to the last item in the queue if it is the same.
                    item.Amount += m_queue[m_queue.Count - 1].Amount;
                    item.ItemId = m_queue[m_queue.Count - 1].ItemId;
                    m_queue[m_queue.Count - 1] = item;
                }
                else
                {
                    if (idx == -1)
                        idx = m_queue.Count;

                    // Reset timer when adding first item. Otherwise we might produce it faster than possible.
                    if (m_queue.Count == 0)
                        m_lastUpdateTime = MySandboxGame.TotalGamePlayTimeInMilliseconds;

                    // Put new item into the queue with given amount and type.
                    item.ItemId = NextItemId;
                    m_queue.Insert(idx, item);
                }

                UpdatePower();

                OnQueueChanged();
            }
        }
开发者ID:Krulac,项目名称:SpaceEngineers,代码行数:45,代码来源:MyProductionBlock.cs


注:本文中的Sandbox.Definitions.MyBlueprintDefinitionBase类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。