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


C# Tile.color方法代碼示例

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


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

示例1: TrackColors

 public static void TrackColors(int i, int j, Tile trackTile, out int frontColor, out int backColor)
 {
     int num;
     int num1;
     Tile tile;
     int num2;
     if (trackTile.type != 314)
     {
         frontColor = 0;
         backColor = 0;
     }
     else
     {
         frontColor = trackTile.color();
         backColor = frontColor;
         if (trackTile.frameY == -1)
         {
             return;
         }
         int num3 = Minecart._leftSideConnection[trackTile.frameX];
         int num4 = Minecart._rightSideConnection[trackTile.frameX];
         int num5 = Minecart._leftSideConnection[trackTile.frameY];
         int num6 = Minecart._rightSideConnection[trackTile.frameY];
         int num7 = 0;
         int num8 = 0;
         int num9 = 0;
         int num10 = 0;
         for (int i1 = 0; i1 < 4; i1++)
         {
             switch (i1)
             {
                 case 1:
                 {
                     num = num4;
                     break;
                 }
                 case 2:
                 {
                     num = num5;
                     break;
                 }
                 case 3:
                 {
                     num = num6;
                     break;
                 }
                 default:
                 {
                     num = num3;
                     break;
                 }
             }
             switch (num)
             {
                 case 0:
                 {
                     num1 = -1;
                     break;
                 }
                 case 1:
                 {
                     num1 = 0;
                     break;
                 }
                 case 2:
                 {
                     num1 = 1;
                     break;
                 }
                 default:
                 {
                     num1 = 0;
                     break;
                 }
             }
             tile = (i1 % 2 != 0 ? Main.tile[i + 1, j + num1] : Main.tile[i - 1, j + num1]);
             if (tile == null || !tile.active() || tile.type != 314)
             {
                 num2 = 0;
             }
             else
             {
                 num2 = tile.color();
             }
             switch (i1)
             {
                 case 1:
                 {
                     num8 = num2;
                     break;
                 }
                 case 2:
                 {
                     num9 = num2;
                     break;
                 }
                 case 3:
                 {
                     num10 = num2;
                     break;
//.........這裏部分代碼省略.........
開發者ID:Celant,項目名稱:TerrariaAPI-Server,代碼行數:101,代碼來源:Minecart.cs

示例2: isTheSameAs

 public bool isTheSameAs(Tile compTile)
 {
     if (compTile == null)
     {
         return false;
     }
     if (this.active() != compTile.active())
     {
         return false;
     }
     if (this.active())
     {
         if (this.type != compTile.type)
         {
             return false;
         }
         if (Main.tileFrameImportant[(int)this.type])
         {
             if (this.frameX != compTile.frameX)
             {
                 return false;
             }
             if (this.frameY != compTile.frameY)
             {
                 return false;
             }
         }
     }
     if (this.wall != compTile.wall)
     {
         return false;
     }
     if (this.liquid != compTile.liquid)
     {
         return false;
     }
     if (this.liquid > 0)
     {
         if (this.lava() != compTile.lava())
         {
             return false;
         }
         if (this.honey() != compTile.honey())
         {
             return false;
         }
     }
     return this.wire() == compTile.wire() && this.wire2() == compTile.wire2() && this.wire3() == compTile.wire3() && this.halfBrick() == compTile.halfBrick() && this.actuator() == compTile.actuator() && this.inActive() == compTile.inActive() && this.wallColor() == compTile.wallColor() && this.color() == compTile.color() && this.slope() == compTile.slope();
 }
開發者ID:jfort,項目名稱:TerrariaAPI-Server,代碼行數:49,代碼來源:Tile.cs

示例3: TrackColors

 public static void TrackColors(int i, int j, Tile trackTile, out int frontColor, out int backColor)
 {
     if (trackTile.type == 314)
     {
         frontColor = (int)trackTile.color();
         backColor = frontColor;
         if (trackTile.frameY == -1)
         {
             return;
         }
         int num = Minecart._leftSideConnection[(int)trackTile.frameX];
         int num2 = Minecart._rightSideConnection[(int)trackTile.frameX];
         int num3 = Minecart._leftSideConnection[(int)trackTile.frameY];
         int num4 = Minecart._rightSideConnection[(int)trackTile.frameY];
         int num5 = 0;
         int num6 = 0;
         int num7 = 0;
         int num8 = 0;
         for (int k = 0; k < 4; k++)
         {
             int num9;
             switch (k)
             {
             case 1:
                 num9 = num2;
                 break;
             case 2:
                 num9 = num3;
                 break;
             case 3:
                 num9 = num4;
                 break;
             default:
                 num9 = num;
                 break;
             }
             int num10;
             switch (num9)
             {
             case 0:
                 num10 = -1;
                 break;
             case 1:
                 num10 = 0;
                 break;
             case 2:
                 num10 = 1;
                 break;
             default:
                 num10 = 0;
                 break;
             }
             Tile tile;
             if (k % 2 == 0)
             {
                 tile = Main.tile[i - 1, j + num10];
             }
             else
             {
                 tile = Main.tile[i + 1, j + num10];
             }
             int num11;
             if (tile == null || !tile.active() || tile.type != 314)
             {
                 num11 = 0;
             }
             else
             {
                 num11 = (int)tile.color();
             }
             switch (k)
             {
             case 1:
                 num6 = num11;
                 break;
             case 2:
                 num7 = num11;
                 break;
             case 3:
                 num8 = num11;
                 break;
             default:
                 num5 = num11;
                 break;
             }
         }
         if (num == num3)
         {
             if (num6 != 0)
             {
                 frontColor = num6;
             }
             else if (num5 != 0)
             {
                 frontColor = num5;
             }
             if (num8 != 0)
             {
                 backColor = num8;
                 return;
//.........這裏部分代碼省略.........
開發者ID:MEFBAEA,項目名稱:mefbaea,代碼行數:101,代碼來源:Minecart.cs

示例4: validateWorld


//.........這裏部分代碼省略.........
                                 {
                                     tile.frameX = binaryReader.ReadInt16();
                                     tile.frameY = binaryReader.ReadInt16();
                                 }
                                 else if (Main.tileFrameImportant[(int)tile.type])
                                 {
                                     if (num < 28 && tile.type == 4)
                                     {
                                         tile.frameX = 0;
                                         tile.frameY = 0;
                                     }
                                     else if (num < 40 && tile.type == 19)
                                     {
                                         tile.frameX = 0;
                                         tile.frameY = 0;
                                     }
                                     else
                                     {
                                         tile.frameX = binaryReader.ReadInt16();
                                         tile.frameY = binaryReader.ReadInt16();
                                         if (tile.type == 144)
                                         {
                                             tile.frameY = 0;
                                         }
                                     }
                                 }
                                 else
                                 {
                                     tile.frameX = -1;
                                     tile.frameY = -1;
                                 }
                                 if (num >= 48 && binaryReader.ReadBoolean())
                                 {
                                     tile.color(binaryReader.ReadByte());
                                 }
                             }
                             if (num <= 25)
                             {
                                 binaryReader.ReadBoolean();
                             }
                             if (binaryReader.ReadBoolean())
                             {
                                 tile.wall = binaryReader.ReadByte();
                                 if (num >= 48 && binaryReader.ReadBoolean())
                                 {
                                     tile.wallColor(binaryReader.ReadByte());
                                 }
                             }
                             if (binaryReader.ReadBoolean())
                             {
                                 tile.liquid = binaryReader.ReadByte();
                                 tile.lava(binaryReader.ReadBoolean());
                                 if (num >= 51)
                                 {
                                     tile.honey(binaryReader.ReadBoolean());
                                 }
                             }
                             if (num >= 33)
                             {
                                 tile.wire(binaryReader.ReadBoolean());
                             }
                             if (num >= 43)
                             {
                                 tile.wire2(binaryReader.ReadBoolean());
                                 tile.wire3(binaryReader.ReadBoolean());
                             }
開發者ID:CoderCow,項目名稱:TerrariaAPI-Server,代碼行數:67,代碼來源:WorldGen.cs

示例5: TrackColors

		public static void TrackColors(int i, int j, Tile trackTile, out int frontColor, out int backColor)
		{
			if (trackTile.type == 314)
			{
				frontColor = (int)trackTile.color();
				backColor = frontColor;
				if (trackTile.frameY == -1)
				{
					return;
				}
				int num = Minecart.leftSideConnection[(int)trackTile.frameX];
				int num2 = Minecart.rightSideConnection[(int)trackTile.frameX];
				int num3 = Minecart.leftSideConnection[(int)trackTile.frameY];
				int num4 = Minecart.rightSideConnection[(int)trackTile.frameY];
				int num5 = 0;
				int num6 = 0;
				int num7 = 0;
				int num8 = 0;
				for (int k = 0; k < 4; k++)
				{
					int num9 = num;
					switch (k)
					{
					case 0:
						num9 = num;
						goto IL_9C;
					case 1:
						num9 = num2;
						goto IL_9C;
					case 2:
						num9 = num3;
						goto IL_9C;
					case 3:
						num9 = num4;
						goto IL_9C;
					}
                    goto IL_9C;
					IL_9C:
					int num10;
					switch (num9)
					{
					case 0:
						num10 = -1;
						break;
					case 1:
						num10 = 0;
						break;
					case 2:
						num10 = 1;
						break;
					default:
						num10 = 0;
						break;
					}
					Tile tile;
					if (k % 2 == 0)
					{
						tile = Main.tile[i - 1, j + num10];
					}
					else
					{
						tile = Main.tile[i + 1, j + num10];
					}
					int num11;
					if (tile == null || !tile.active() || tile.type != 314)
					{
						num11 = 0;
					}
					else
					{
						num11 = (int)tile.color();
					}
					switch (k)
					{
					case 0:
						IL_139:
						num5 = num11;
						goto IL_14F;
					case 1:
						num6 = num11;
						goto IL_14F;
					case 2:
						num7 = num11;
						goto IL_14F;
					case 3:
						num8 = num11;
						goto IL_14F;
					}
					//EDIT: goto IL_139; // This whole part does nothing anyway..?
					IL_14F:;
				}
				if (num == num3)
				{
					if (num6 != 0)
					{
						frontColor = num6;
					}
					else if (num5 != 0)
					{
						frontColor = num5;
//.........這裏部分代碼省略.........
開發者ID:EdgeKiller,項目名稱:terrariaSource,代碼行數:101,代碼來源:Minecart.cs

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