Пример #1
0
 public Object.Object addObject(Object.Object _Object, Boolean _InsertInQuadTree, Region.Region _Region)
 {
     if (_InsertInQuadTree)
     {
         this.quadTreeObject.Insert(_Object);
     }
     if (_Region != null)
     {
         Chunk.Chunk chunk = _Region.getChunkAtPosition(_Object.Position);
         if (chunk != null)
         {
             Block.Block var_Block = chunk.getBlockAtCoordinate(_Object.Position);
             if (var_Block != null)
             {
                 var_Block.addObject(_Object);
                 if (Configuration.Configuration.isHost)
                 {
                     Configuration.Configuration.networkManager.addEvent(new GameLibrary.Connection.Message.UpdateObjectMessage(_Object), GameMessageImportance.VeryImportant);
                 }
             }
         }
     }
     else
     {
         Logger.Logger.LogInfo("World.addObject: Object konnte der Region nicht hinzugefügt werden, da diese null war");
     }
     return(_Object);
 }
Пример #2
0
 public Block.Block getBlockAtCoordinate(Vector3 _Position)
 {
     Chunk.Chunk var_Chunk = this.getChunkAtPosition(_Position);
     if (var_Chunk != null)
     {
         return(var_Chunk.getBlockAtCoordinate(_Position));
     }
     return(null);
 }