當前位置: 首頁>>代碼示例>>C#>>正文


C# Tile.liquidType方法代碼示例

本文整理匯總了C#中Terraria.Tile.liquidType方法的典型用法代碼示例。如果您正苦於以下問題:C# Tile.liquidType方法的具體用法?C# Tile.liquidType怎麽用?C# Tile.liquidType使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Terraria.Tile的用法示例。


在下文中一共展示了Tile.liquidType方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: LiquidPlace

 public bool LiquidPlace(Tile checkTile)
 {
     if (checkTile == null)
     {
         return false;
     }
     if (checkTile.liquid <= 0)
     {
         switch (checkTile.liquidType())
         {
             case 0:
             case 2:
             {
                 if (this.WaterPlacement != LiquidPlacement.OnlyInFullLiquid && this.WaterPlacement != LiquidPlacement.OnlyInLiquid)
                 {
                     break;
                 }
                 return false;
             }
             case 1:
             {
                 if (this.LavaPlacement != LiquidPlacement.OnlyInFullLiquid && this.LavaPlacement != LiquidPlacement.OnlyInLiquid)
                 {
                     break;
                 }
                 return false;
             }
         }
     }
     else
     {
         switch (checkTile.liquidType())
         {
             case 0:
             case 2:
             {
                 if (this.WaterPlacement == LiquidPlacement.NotAllowed)
                 {
                     return false;
                 }
                 if (this.WaterPlacement != LiquidPlacement.OnlyInFullLiquid || checkTile.liquid == 255)
                 {
                     break;
                 }
                 return false;
             }
             case 1:
             {
                 if (this.LavaPlacement == LiquidPlacement.NotAllowed)
                 {
                     return false;
                 }
                 if (this.LavaPlacement != LiquidPlacement.OnlyInFullLiquid || checkTile.liquid == 255)
                 {
                     break;
                 }
                 return false;
             }
         }
     }
     return true;
 }
開發者ID:sylar605,項目名稱:TshockCN,代碼行數:62,代碼來源:TileObjectData.cs

示例2: LiquidPlace

 public bool LiquidPlace(Tile checkTile)
 {
     if (checkTile == null)
         return false;
     if ((int)checkTile.liquid > 0)
     {
         switch (checkTile.liquidType())
         {
             case (byte)0:
             case (byte)2:
                 if (this.WaterPlacement == LiquidPlacement.NotAllowed || this.WaterPlacement == LiquidPlacement.OnlyInFullLiquid && (int)checkTile.liquid != (int)byte.MaxValue)
                     return false;
                 break;
             case (byte)1:
                 if (this.LavaPlacement == LiquidPlacement.NotAllowed || this.LavaPlacement == LiquidPlacement.OnlyInFullLiquid && (int)checkTile.liquid != (int)byte.MaxValue)
                     return false;
                 break;
         }
     }
     else
     {
         switch (checkTile.liquidType())
         {
             case (byte)0:
             case (byte)2:
                 if (this.WaterPlacement == LiquidPlacement.OnlyInFullLiquid || this.WaterPlacement == LiquidPlacement.OnlyInLiquid)
                     return false;
                 break;
             case (byte)1:
                 if (this.LavaPlacement == LiquidPlacement.OnlyInFullLiquid || this.LavaPlacement == LiquidPlacement.OnlyInLiquid)
                     return false;
                 break;
         }
     }
     return true;
 }
開發者ID:EmuDevs,項目名稱:EDTerraria,代碼行數:36,代碼來源:TileObjectData.cs

示例3: Tile

        private void Tile(Tile tile)
        {
            byte flags = 0;

            var active = tile.active();
            var wall = tile.wall;
            var liquid = tile.liquid;

            if (active) flags += 1;
            //if (tile.Lighted)    flags += 2; //UNUSED
            if (wall > 0) flags += 4;
            if (liquid > 0) flags += 8;
            if (tile.wire()) flags += 16;
            if (tile.halfBrick()) flags += 32;
            if (tile.actuator()) flags += 64;
            if (tile.inActive()) flags += 128;

            Byte(flags);

            byte tileColour = 0, wallColour = 0;
            flags = 0;
            if (tile.wire2()) flags += 1;
            if (tile.wire3()) flags += 2;
            if (tile.active() && tile.color() > 0)
            {
                flags += 4;
                tileColour = tile.color();
            }
            if (tile.wall > 0 && tile.wallColor() > 0)
            {
                flags += 8;
                wallColour = tile.wallColor();
            }
            Byte(flags + (byte)(tile.slope() << 4));

            if (tileColour > 0) Byte(tileColour);
            if (wallColour > 0) Byte(wallColour);

            if (tile.active())
            {
                UShort(tile.type);
                if (Main.tileFrameImportant[(int)tile.type])
                {
                    Short(tile.frameX);
                    Short(tile.frameY);
                }
            }
            if (tile.wall > 0) Byte(tile.wall);

            if (tile.liquid > 0)
            {
                Byte(tile.liquid);
                Byte(tile.liquidType());
            }
        }
開發者ID:VanixxGraphix,項目名稱:Terraria-s-Dedicated-Server-Mod,代碼行數:55,代碼來源:NewNetMessage_Packets.cs


注:本文中的Terraria.Tile.liquidType方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。