Esempio n. 1
0
 public bool DeleteScene()
 {
     mScene = null;
     return(true);
 }
Esempio n. 2
0
 public GameClient()
 {
     mScene = null;
     mViews = new GameObjectSet();
 }
Esempio n. 3
0
 /// <summary>
 /// 创建场景对象
 /// </summary>
 /// <param name="player_ident">主角ObjID</param>
 public GameScene CreateScene(ObjectID player_ident)
 {
     mScene          = new GameScene();
     mStrPlayerIdent = player_ident;
     return(mScene);
 }
Esempio n. 4
0
        public bool AddRecord(ref GameScene obj, int index)
        {
            try
            {
                if (index < 0 || index > mRecordTable.Count)
                {
                    //Log.Trace("index error");
                    return(false);
                }

                if (null == obj)
                {
                    //Log.Trace("obj is null");
                    return(false);
                }

                if (!mRecordTable.ContainsKey(index))
                {
                    //Log.Trace("not include index:" + index.ToString());
                    return(false);
                }

                RecData    recData = mRecordTable[index];
                GameRecord record  = new GameRecord();
                record.SetName(recData.strName);
                record.SetColCount(recData.nCols);
                for (int i = 0; i < recData.nCols; i++)
                {
                    int type = recData.ColTypes[i];
                    switch (type)
                    {
                    case OuterDataType.OUTER_TYPE_BYTE:
                    case OuterDataType.OUTER_TYPE_WORD:
                    case OuterDataType.OUTER_TYPE_DWORD:
                    {
                        record.SetColType(i, VarType.Int);
                    }
                    break;

                    case OuterDataType.OUTER_TYPE_QWORD:
                    {
                        record.SetColType(i, VarType.Int64);
                    }
                    break;

                    case OuterDataType.OUTER_TYPE_FLOAT:
                    {
                        record.SetColType(i, VarType.Float);
                    }
                    break;

                    case OuterDataType.OUTER_TYPE_DOUBLE:
                    {
                        record.SetColType(i, VarType.Double);
                    }
                    break;

                    case OuterDataType.OUTER_TYPE_STRING:
                    {
                        record.SetColType(i, VarType.String);
                    }
                    break;

                    case OuterDataType.OUTER_TYPE_WIDESTR:
                    {
                        record.SetColType(i, VarType.WideStr);
                    }
                    break;

                    case OuterDataType.OUTER_TYPE_OBJECT:
                    {
                        record.SetColType(i, VarType.Object);
                    }
                    break;

                    default:
                        //Log.Trace("unkown type");
                        break;
                    }
                }//end for

                return(obj.AddRecord2Set(recData.strName, ref record));
            }//end try
            catch (Exception ex)
            {
                //Log.Trace("Exception:" + ex.ToString());
                return(false);
            }
        }