コード例 #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 Chunk.Chunk getChunkAtPosition(Vector3 _Position)
 {
     Region.Region var_Region = this.getRegionAtPosition(_Position);
     if (var_Region != null)
     {
         return(var_Region.getChunkAtPosition(_Position));
     }
     return(null);
 }