예제 #1
0
파일: Engine.cs 프로젝트: Skinny1001/PlayUO
 public static void Preload(Worker w)
 {
     TileMatrix matrix = w.Matrix;
     int blockWidth = matrix.BlockWidth;
     int blockHeight = matrix.BlockHeight;
     if ((((w.X >= 0) && (w.Y >= 0)) && (w.X < blockWidth)) && (w.Y < blockHeight))
     {
         Mobile player = World.Player;
         bool grayscale = (player != null) && player.Ghost;
         IHintable hintable = grayscale ? ((IHintable) Hues.Grayscale) : ((IHintable) Hues.Default);
         MapBlock block = matrix.GetBlock(w.X, w.Y);
         bool flag2 = false;
         for (int i = 0; !flag2 && (i < m_KeepAliveBlocks.Length); i++)
         {
             flag2 = m_KeepAliveBlocks[i] == block;
         }
         if (!flag2)
         {
             m_KeepAliveBlocks[m_KeepAliveBlockIndex % m_KeepAliveBlocks.Length] = block;
             m_KeepAliveBlockIndex++;
         }
         Tile[] tileArray = (block == null) ? matrix.InvalidLandBlock : block.m_LandTiles;
         for (int j = 0; j < tileArray.Length; j++)
         {
             if (!hintable.HintLand(tileArray[j].ID & 0x3fff))
             {
                 m_LoadQueue.Enqueue(new LandLoader(tileArray[j].ID & 0x3fff, grayscale));
             }
         }
         HuedTile[][][] tileArray2 = (block == null) ? matrix.EmptyStaticBlock : block.m_StaticTiles;
         for (int k = 0; k < 8; k++)
         {
             for (int m = 0; m < 8; m++)
             {
                 HuedTile[] tileArray3 = tileArray2[k][m];
                 for (int n = 0; n < tileArray3.Length; n++)
                 {
                     if ((tileArray3[n].Hue == 0) && !hintable.HintItem(tileArray3[n].ID & 0x3fff))
                     {
                         m_LoadQueue.Enqueue(new ItemLoader(tileArray3[n].ID & 0x3fff, grayscale));
                     }
                 }
             }
         }
     }
 }