コード例 #1
0
ファイル: GameClient.cs プロジェクト: 56059943/test1
        public void CloneObj(ref IGameObj obj, ref IGameObj cloneObj)
        {
            Dictionary <string, GameProperty> mPropSet = cloneObj.PropSets();

            foreach (KeyValuePair <string, GameProperty> kvp in mPropSet)
            {
                string key = kvp.Key;
                obj.UpdateProperty(ref key, kvp.Value.propValue.Clone());
            }


            VarList recordList = new VarList();

            cloneObj.GetRecordList(ref recordList);
            int count = recordList.GetCount();

            for (int i = 0; i < count; i++)
            {
                string     recordName = recordList.GetString(i);
                GameRecord record     = cloneObj.GetGameRecordByName(recordName).Clone();
                obj.AddRecord2Set(recordName, ref record);
            }
        }