Example #1
0
    public void UpgradeBuildingWithSubType(ObjectSubType subTypeToUpgrade)
    {
        subTypeLevelMap[(int)subTypeToUpgrade]++;
        int newLevel = subTypeLevelMap[(int)subTypeToUpgrade];

        foreach (ObjectMetadata metadata in CraftingManager.Instance.GetUnlockedCrafts())
        {
            if (metadata.subType == subTypeToUpgrade)
            {
                if (techTreeLevelMap[metadata.techTreeId] < newLevel)
                {
                    techTreeLevelMap[metadata.techTreeId] = subTypeLevelMap[(int)subTypeToUpgrade];
                }
            }
        }
    }
Example #2
0
    public void UpgradeBuildings(ObjectSubType subType, int level)
    {
        var iter = gameObjectOnMapDictionary.GetEnumerator();

        while (iter.MoveNext())
        {
            InteractiveObject interactiveObject = iter.Current.Key.GetComponent <InteractiveObject>();
            if (interactiveObject.objectMetadata.subType == subType && interactiveObject.objectMetadata.level < level)
            {
                var objMetaData = metadataManager.GetObjectMetadataWithObjectId(interactiveObject.objectMetadata.objectId + level - interactiveObject.objectMetadata.level);
                if (objMetaData != null)
                {
                    GameObject originObj = iter.Current.Key;
                    GameObject obj       = objMetaData.GetGameObjectFromPool(sceneRoot.transform);
                    obj.transform.SetPositionAndRotation(originObj.transform.position, originObj.transform.rotation);

                    originToNew.Add(originObj, obj);
                }
            }
        }

        for (int i = 0; i < mapNodes.GetLength(0); i++)
        {
            for (int j = 0; j < mapNodes.GetLength(1); j++)
            {
                if (mapNodes[i, j].gameObject != null &&
                    originToNew.ContainsKey(mapNodes[i, j].gameObject))
                {
                    GameObject origin = mapNodes[i, j].gameObject;
                    mapNodes[i, j].gameObject = originToNew[origin];
                    gameObjectOnMapDictionary.Add(mapNodes[i, j].gameObject, true);
                    gameObjectOnMapDictionary.Remove(origin);
                    GameObject.Destroy(origin);
                }
            }
        }

        originToNew.Clear();
    }
Example #3
0
        public static ObjectTypes GetObjectType(this NXObject obj)
        {
            theUfSession.Obj.AskTypeAndSubtype(obj.Tag, out int type, out int subType);
            ObjectType objType = (ObjectType)type;

            if (type == 70)
            {
                if (subType == 0)
                {
                    objType = ObjectType.Body;
                }
                else if (subType == 2)
                {
                    objType = ObjectType.Face;
                }
                else if (subType == 3)
                {
                    objType = ObjectType.Edge;
                }
            }
            else if (type == 205)
            {
                Feature feature = (Feature)obj;
                if (feature is DatumAxisFeature)
                {
                    objType = ObjectType.DatumAxis;
                }
                else if (feature is DatumPlaneFeature)
                {
                    objType = ObjectType.DatumPlane;
                }
            }


            ObjectSubType objSubtype = (ObjectSubType)(100 * type + subType);

            return(new ObjectTypes(objType, objSubtype));
        }
Example #4
0
 /// <summary>Constructs a new TypeCombo from a given type and subtype</summary>
 /// <param name="type">The object type</param>
 /// <param name="subtype">The object subtype</param>
 public ObjectTypes(ObjectType type, ObjectSubType subtype)
 {
     Type    = type;
     SubType = subtype;
 }
Example #5
0
 public PdfString(ObjectSubType subType) : base(ObjectType.STRING, subType)
 {
 }
Example #6
0
            /// <summary>
            /// コンストラクター: 一行文字列からデータを生成する
            /// </summary>
            public SQObject(ObjectSubType subType, bool isFunc, string buf)
            {
                int    idx;
                string temp;

                string[] list, subList;

                //与えられたままに決定するもの
                this.SubType = subType;
                this.IsFunc  = isFunc;

                //大種別を決定する
                switch (subType)
                {
                case ObjectSubType.Const:
                case ObjectSubType.Enum:
                case ObjectSubType.EnumMember:
                    this.NodeID = ObjectType.Const;
                    break;

                case ObjectSubType.GlobalValue:
                    this.NodeID = ObjectType.Value;
                    break;

                case ObjectSubType.GlobalFunc:
                    this.NodeID = ObjectType.Function;
                    break;

                case ObjectSubType.SQFunc:
                    this.NodeID = ObjectType.SQEventHandler;
                    break;

                default:
                    this.NodeID = ObjectType.GameObject;
                    break;
                }

                //小種別ごとの処理
                switch (subType)
                {
                case ObjectSubType.Const:
                    this.Name      = this.getDQArea(buf);
                    this.ClassPath = this.get2ndArg(buf).Replace("(int)", "").Replace("(float)", "").Replace(".c_str()", "");           //整数・小数・文字列の変換部分を除去
                    if (this.ClassPath.IndexOf("::") == -1)
                    {
                        //グローバル定数の例外措置
                        this.ClassPath = this.Name;
                    }
                    this.ReturnType = this.getCommentArea(buf);
                    break;

                case ObjectSubType.Enum:
                    this.Name      = this.getDQArea(buf);
                    this.ClassPath = this.getCommentArea(buf);
                    break;

                case ObjectSubType.EnumMember:
                    this.Name      = this.getDQArea(buf);
                    this.ClassPath = this.get2ndArg(buf).Replace("(int)", "");              //整数への変換部分を除去
                    break;

                case ObjectSubType.GlobalValue:
                    this.Name       = this.getDQArea(buf);
                    this.ClassPath  = this.Name;
                    this.ReturnType = this.getCommentArea(buf);
                    break;

                case ObjectSubType.GlobalFunc:
                    this.Name      = this.getDQArea(buf);
                    this.ClassPath = this.Name;

                    //戻り値・引数情報
                    list            = this.getCommentArea(buf).Split('|'); //戻り値と引数リストに分ける
                    this.ReturnType = list[0];
                    this.ArgumentList.Clear();
                    this.ArgComments.Clear();
                    if (!string.IsNullOrEmpty(list[1]))
                    {
                        subList = list[1].Split(',');
                        for (var i = 0; i < subList.Length; i++)
                        {
                            this.ArgumentList.Add(subList[i]);
                            this.ArgComments.Add("");
                        }
                    }
                    break;

                case ObjectSubType.Class:
                    this.Name      = this.getDQArea(buf);
                    temp           = this.getBracketArea(buf).Replace(", ", ",");
                    this.ClassPath = temp;
                    idx            = temp.IndexOf(",");
                    if (idx != -1)
                    {
                        //継承元クラスがある場合は分解する
                        this.ClassPath      = temp.Substring(0, idx);
                        this.SuperClassName = temp.Substring(idx + 1);
                    }
                    break;

                case ObjectSubType.MemberValue:
                case ObjectSubType.ClassValue:
                    this.Name       = this.getDQArea(buf);
                    temp            = this.get2ndArg(buf);
                    this.ClassPath  = temp.Substring(temp.IndexOf("&") + 1);
                    this.ReturnType = this.getCommentArea(buf);
                    break;

                case ObjectSubType.MemberProperty:
                    this.Name       = this.getDQArea(buf);
                    this.ClassPath  = this.getPropertyClassPath(buf);
                    this.ReturnType = this.getCommentArea(buf);
                    if (!this.checkPropertySetter(buf))
                    {
                        //setterを含まない場合は型名に ReadOnly を付加する
                        this.ReturnType += " (読み取り専用)";
                    }
                    break;

                case ObjectSubType.ClassFunc:
                case ObjectSubType.MemberFunc:
                    this.Name      = this.getDQArea(buf);
                    temp           = this.get2ndArg(buf);
                    this.ClassPath = temp.Substring(temp.IndexOf("&") + 1);

                    //戻り値・引数情報
                    list            = this.getCommentArea(buf).Split('|'); //戻り値と引数リストに分ける
                    this.ReturnType = list[0];
                    this.ArgumentList.Clear();
                    this.ArgComments.Clear();
                    if (!string.IsNullOrEmpty(list[1]))
                    {
                        subList = list[1].Split(',');
                        for (var i = 0; i < subList.Length; i++)
                        {
                            this.ArgumentList.Add(subList[i]);
                            this.ArgComments.Add("");
                        }
                    }
                    break;

                case ObjectSubType.SQFunc:
                    this.Name      = this.getDQArea(buf);
                    this.ClassPath = "SQEventHandler::" + this.Name;

                    //戻り値・引数情報
                    temp = buf.Substring(buf.LastIndexOf("\",") + 3);
                    temp = temp.Substring(0, temp.IndexOf(");"));
                    temp = temp.Trim();
                    list = temp.Split(',');
                    if (list.Length > 0)
                    {
                        this.ReturnType = list[0];
                        this.ArgumentList.Clear();
                        this.ArgComments.Clear();
                        for (var i = 1; i < list.Length; i++)
                        {
                            this.ArgumentList.Add(list[i].Trim());
                            this.ArgComments.Add("");
                        }
                    }
                    break;
                }
            }
Example #7
0
 public PdfNumber(ObjectSubType subType) : base(ObjectType.NUMBER, subType)
 {
 }
Example #8
0
 public PdfObject(ObjectType type, ObjectSubType subType)
 {
     this.Type    = type;
     this.SubType = subType;
 }