00001 using System;
00002 using System.Collections.Generic;
00003 using System.Text;
00004
00005 namespace Server
00006 {
00011 public abstract class UniquelyIdentifiable
00012 {
00013 private static int nextID = 0;
00014 private int id;
00015
00020 public UniquelyIdentifiable(int id)
00021 {
00022 this.id = Next(id);
00023 }
00024
00028 public static int NextID
00029 {
00030 get { return nextID;}
00031 }
00035 public static void Reset()
00036 {
00037 nextID = 0;
00038 }
00039
00040 private int Next(int h)
00041 {
00042 if (h >= nextID)
00043 nextID = h + 1;
00044
00045 return h;
00046 }
00047
00051 public int ID
00052 {
00053 get { return id; }
00054 }
00055
00056 }
00057 }