コード例 #1
0
 public MyDefinitionId(Sandbox.Common.ObjectBuilders.MyObjectBuilderType type)
 {
     TypeId      = type;
     SubtypeName = (string)null;
 }
コード例 #2
0
 public MyDefinitionId(Sandbox.Common.ObjectBuilders.MyObjectBuilderType type, string subtypeName)
 {
     TypeId      = type;
     SubtypeName = subtypeName;
 }
コード例 #3
0
 public override bool CanStack(MyObjectBuilderType typeId, VRage.Library.Utils.MyStringId subtypeId, MyItemFlags flags)
 {
     return(false);
 }
コード例 #4
0
 public static string ToString(Sandbox.Common.ObjectBuilders.MyObjectBuilderType typeId)
 {
     return(typeId.ToString().Split('_')[1]);
 }
コード例 #5
0
 public override bool CanStack(MyObjectBuilderType type, MyStringHash subtypeId, MyItemFlags flags)
 {
     return(false); // weapons shouldn't stack
 }
コード例 #6
0
 public bool Equals(MyObjectBuilderType type)
 {
     return(type.m_type == this.m_type);
 }
コード例 #7
0
 internal static void RegisterLegacyName(MyObjectBuilderType type, string legacyName)
 {
     m_typeByLegacyName.Add(legacyName, type);
 }
コード例 #8
0
 public static bool TryParse(string value, out MyObjectBuilderType result)
 {
     return(m_typeByName.TryGetValue(value, out result));
 }
コード例 #9
0
        public static MyObjectBuilder_CubeBlock Upgrade(MyObjectBuilder_CubeBlock cubeBlock, MyObjectBuilderType newType, string newSubType)
        {
            var upgraded = MyObjectBuilderSerializer.CreateNewObject(newType, newSubType) as MyObjectBuilder_CubeBlock;

            if (upgraded == null)
            {
                Debug.Fail("Cannot upgrade cube block, upgraded block is not derived from " + typeof(MyObjectBuilder_CubeBlock).Name);
                return(null);
            }

            upgraded.EntityId              = cubeBlock.EntityId;
            upgraded.Min                   = cubeBlock.Min;
            upgraded.m_orientation         = cubeBlock.m_orientation;
            upgraded.IntegrityPercent      = cubeBlock.IntegrityPercent;
            upgraded.BuildPercent          = cubeBlock.BuildPercent;
            upgraded.BlockOrientation      = cubeBlock.BlockOrientation;
            upgraded.ConstructionInventory = cubeBlock.ConstructionInventory;
            upgraded.ColorMaskHSV          = cubeBlock.ColorMaskHSV;

            return(upgraded);
        }