Ejemplo n.º 1
0
        public int GetItemCountFromInventory(IMyInventory inventory, string itemName)
        {
            MyDefinitionId myDefinitionId = GetMyDefinitionIdByName(itemName);
            MyItemType     myItemType     = MyItemType.MakeComponent(myDefinitionId.SubtypeId.ToString());

            return((int)inventory.GetItemAmount(myItemType));
        }
Ejemplo n.º 2
0
 // !!! Only handles components as they can be produced by the assembler (MakeComponent) !!!
 public MyItemType GetMyItemTypeByMyDefinitionId(MyDefinitionId myDefinitionId)
 {
     return(MyItemType.MakeComponent(myDefinitionId.SubtypeId.ToString()));
 }
Ejemplo n.º 3
0
 private static MyItemType component(string name)
 {
     return(MyItemType.MakeComponent(name));
 }
Ejemplo n.º 4
0
 public static MyInventoryItem MockComponent(String subType, float amount = 1)
 {
     return(new MyInventoryItem(MyItemType.MakeComponent(subType), 0, (MyFixedPoint)amount));
 }