Esempio n. 1
0
 public World(Guid gameId)
     : base(100, 100, 10)
 {
     InterestManager.Instance.init(this);
     this.gameId = gameId;
     timer = GameTimer.getGameTimer(DateTime.Now);
     timer.timeLapsed += new EventHandler<GameTimerEventArgs>(this.timelapsed);
     map = new Terrain[100, 100];
     for (int x = 0; x < 100; x++)
     {
         for (int y = 0; y < 100; y++)
         {
             Terrain t = new Terrain(new Position(x, y, 0));
             t.AssetId = 1000001;
             map[x, y] = t;
         }
     }
     for (int m = 0; m < 1000; m++)
     {
         Mobile mob = new Mobile(new Position(Game.Random.Next(100), Game.Random.Next(100), Game.Random.Next(100)));
         mob.AssetId = 1000001;
         Mobiles.Add(mob);
     }
 }
Esempio n. 2
0
 /// <summary>
 /// Gets the game timer.
 /// </summary>
 /// <param name="referencePoint">The reference point.</param>
 /// <returns></returns>
 public static GameTimer getGameTimer(DateTime referencePoint)
 {
     GameTimer gt = new GameTimer();
     gt.referencePoint = referencePoint;
     gt.worldTime = gt.referencePoint;
     gt.start = DateTime.Now;
     gt.current = DateTime.Now;
     return gt;
 }