private short NextObjID() { for (short i = ObjectId; i > 0; i++) if (!ObjectsById.ContainsKey(i)) return i; return 0; }