static int SortById(TriggerProtoDbObject x, TriggerProtoDbObject y) { if (x.DbId != y.DbId) { return(x.DbId - y.DbId); } return(x.Version - y.Version); }
static void TraceUpdate(BTriggerSystem ts, TriggerProtoDbObject dbo) { Debug.Trace.Engine.TraceInformation( "TriggerProtoDbObject: {0} - Updated {1}/{2}", ts, dbo.DbId.ToString(), dbo.Name); }
bool LookupTableContains <T>(T obj, out TriggerProtoDbObject dbo) where T : TriggerScriptDbObject { return(LookupTable.TryGetValue(GenerateHandle(obj), out dbo)); }
void LookupTableAdd(TriggerProtoDbObject dbo) { mUsedIds[dbo.DbId] = true; LookupTable.Add(GenerateHandle(dbo), dbo); }
static uint GenerateHandle(TriggerProtoDbObject dbo) { return(((uint)dbo.DbId << 8) | (uint)dbo.Version); }