public RecData GetRecDataByIndex(int index) { try { if (!mRecordTable.ContainsKey(index)) { return(null); } RecData rec = mRecordTable[index]; return(rec); } catch (Exception ex) { //Log.Trace("GameReceiver.GetRecDataByIndex Exception:" + ex.ToString()); return(null); } }
public void AddRecData(int index, ref RecData recData) { if (mRecordTable == null) { //Log.Trace("GameReceiver.AddRecData mPropertyTable is null"); return; } try { if (mRecordTable.ContainsKey(index)) { //Log.Trace("GameReceiver.AddRecData Has Same Index:" + index); return; } mRecordTable.Add(index, recData); } catch (Exception ex) { //Log.Trace("GameReceiver.AddRecData Exception:" + ex.ToString()); return; } }
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); } }