当前位置: 首页>>代码示例>>C#>>正文


C# Terraria.Tile类代码示例

本文整理汇总了C#中Terraria.Tile的典型用法代码示例。如果您正苦于以下问题:C# Tile类的具体用法?C# Tile怎么用?C# Tile使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Tile类属于Terraria命名空间,在下文中一共展示了Tile类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: isTheSameAs

 public bool isTheSameAs(Tile compTile)
 {
     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;
             }
         }
     }
     return this.wall == compTile.wall && this.liquid == compTile.liquid && this.lava == compTile.lava && this.wire == compTile.wire;
 }
开发者ID:vharonftw,项目名称:Terraria-Server-,代码行数:26,代码来源:Tile.cs

示例2: LiquidRenderer

 static LiquidRenderer()
 {
     LiquidRenderer.WATERFALL_LENGTH = new int[] { 10, 3, 2 };
     LiquidRenderer.DEFAULT_OPACITY = new float[] { 0.6f, 0.95f, 0.95f };
     LiquidRenderer.EMPTY_TILE = new Tile();
     LiquidRenderer.Instance = new LiquidRenderer();
 }
开发者ID:hastinbe,项目名称:TerrariaAPI-Server,代码行数:7,代码来源:LiquidRenderer.cs

示例3: Tile

		public Tile(Tile copy)
		{
			if (copy == null)
			{
				this.type = 0;
				this.wall = 0;
				this.liquid = 0;
				this.sTileHeader = 0;
				this.bTileHeader = 0;
				this.bTileHeader2 = 0;
				this.bTileHeader3 = 0;
				this.frameX = 0;
				this.frameY = 0;
				return;
			}
			this.type = copy.type;
			this.wall = copy.wall;
			this.liquid = copy.liquid;
			this.sTileHeader = copy.sTileHeader;
			this.bTileHeader = copy.bTileHeader;
			this.bTileHeader2 = copy.bTileHeader2;
			this.bTileHeader3 = copy.bTileHeader3;
			this.frameX = copy.frameX;
			this.frameY = copy.frameY;
		}
开发者ID:vito19,项目名称:TerrariaAPI-Server,代码行数:25,代码来源:Tile.cs

示例4: IsTileTheSame

        public static bool IsTileTheSame(Tile tile1, Tile tile2)
        {
            if (tile1.active() != tile2.active())
                return false;

            if (tile1.active())
            {
                if (tile1.type != tile2.type)
                    return false;

                if (Main.tileFrameImportant[(int)tile1.type])
                {
                    if ((tile1.frameX != tile2.frameX) || (tile1.frameX != tile2.frameX))
                        return false;
                }
            }
            return
                tile1.wall == tile2.wall
                &&
                tile1.liquid == tile2.liquid
                &&
                tile1.lava() == tile2.lava()
                &&
                tile1.wire() == tile2.wire()
                &&
                tile1.wire2() == tile2.wire2()
                &&
                tile1.wire3() == tile2.wire3();
        }
开发者ID:VanixxGraphix,项目名称:Terraria-s-Dedicated-Server-Mod,代码行数:29,代码来源:World.cs

示例5: TileEvent

 public TileEvent(Tile tile, Player player, int changeType)
     : base(player)
 {
     base.setState(false);
     this.tile = tile;
     this.changeType = changeType;
 }
开发者ID:pandabear41,项目名称:tLinux,代码行数:7,代码来源:TileEvent.cs

示例6: GetTileSafely

 public static Tile GetTileSafely(int i, int j)
 {
     Tile tile = Main.tile[i, j];
     if (tile == null)
     {
         tile = new Tile();
         Main.tile[i, j] = tile;
     }
     return tile;
 }
开发者ID:hastinbe,项目名称:TerrariaAPI-Server,代码行数:10,代码来源:Framing.cs

示例7: WorldRenderer

 public WorldRenderer(Tile[,] tiles, int worldWidth, int worldHeight, double worldSurface, double rockLayer)
 {
     Tiles = tiles;
     MaxX = worldWidth;
     MaxY = worldHeight;
     SurfaceY = (int)worldSurface;
     RockLayerY = (int)rockLayer + (600 / 16);
     HellLayerY = MaxY - 195;
     Colors = TerrariaColors.GetColors();
 }
开发者ID:Jaex,项目名称:Terraria-API,代码行数:10,代码来源:WorldRenderer.cs

示例8: LoadWorldData

		public static Tile[,] LoadWorldData(string path)
		{
			Tile[,] tile;
			using (BinaryReader reader = new BinaryReader(new FileStream(path, FileMode.Open)))
			{
				int xLen = reader.ReadInt32();
				int yLen = reader.ReadInt32();
				tile = new Tile[xLen, yLen];

				for (int i = 0; i < xLen; i++)
				{
					for (int j = 0; j < yLen; j++)
					{
						tile[i, j] = ReadTile(reader);
					}
				}
				return tile;
			}
		}
开发者ID:Jewsus,项目名称:Mazes,代码行数:19,代码来源:Tools.cs

示例9: isTheSameAs

 public bool isTheSameAs(Tile compTile)
 {
     if (this.active != compTile.active)
     {
         return false;
     }
     if (this.active)
     {
         if (this.type != compTile.type)
         {
             return false;
         }
         if (Main.tileFrameImportant[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.lava != compTile.lava)
     {
         return false;
     }
     if (this.wire != compTile.wire)
     {
         return false;
     }
     return true;
 }
开发者ID:vharonftw,项目名称:Terraria-client-,代码行数:42,代码来源:Tile.cs

示例10: k_Constructor

		public void k_Constructor(Tile copy)
		{
			if (copy == null)
			{
				k_block = null;
				k_wall_protoID = 0;
				k_wall_variant = 0;
				k_wall_colourID = 0;
				k_liquid_protoID = 0;
				k_liquid_amount = 0;
				k_wireFlags = 0;
			}
			else
			{
				k_block = copy.k_block.Copy();
				k_wall_protoID = copy.k_wall_protoID;
				k_wall_variant = copy.k_wall_variant;
				k_wall_colourID = copy.k_wall_colourID;
				k_liquid_protoID = copy.k_liquid_protoID;
				k_liquid_amount = copy.k_liquid_amount;
				k_wireFlags = copy.k_wireFlags;
			}
		}
开发者ID:EmuDevs,项目名称:EDTerraria,代码行数:23,代码来源:Tile.cs

示例11: LoadWorldData

		public static Tile[,] LoadWorldData(string path)
		{
			Tile[,] tile;
			// GZipStream is already buffered, but it's much faster to have a 1 MB buffer.
			using (var reader =
				new BinaryReader(
					new BufferedStream(
						new GZipStream(File.Open(path, FileMode.Open), CompressionMode.Decompress), BUFFER_SIZE)))
			{
				reader.ReadInt32();
				reader.ReadInt32();
				int width = reader.ReadInt32();
				int height = reader.ReadInt32();
				tile = new Tile[width, height];

				for (int i = 0; i < width; i++)
				{
					for (int j = 0; j < height; j++)
						tile[i, j] = ReadTile(reader);
				}
				return tile;
			}
		}
开发者ID:Marcus101RR,项目名称:WorldEdit,代码行数:23,代码来源:Tools.cs

示例12: Tiles

 public Tiles(Tile Maintile, Point Loc)
 {
     this.maintile = Maintile;
      this.loc = Loc;
 }
开发者ID:dantedom,项目名称:editormod,代码行数:5,代码来源:TileBufferStructure.cs

示例13: DrawWaterfall


//.........这里部分代码省略.........
							Rectangle value = new Rectangle(num24 * 18, 0, 16, 16);
							Rectangle value2 = new Rectangle(num23 * 18, 0, 16, 16);
							Vector2 origin = new Vector2(8f, 8f);
							Vector2 position;
							if (num14 % 2 == 0)
							{
								position = new Vector2((float)(num13 * 16 + 9), (float)(num14 * 16 + 8)) - Main.screenPosition;
							}
							else
							{
								position = new Vector2((float)(num13 * 16 + 8), (float)(num14 * 16 + 8)) - Main.screenPosition;
							}
							bool flag = false;
							for (int j = 0; j < num22; j++)
							{
								Color color = Lighting.GetColor(num13, num14);
								float num25 = 0.6f;
								float num26 = 0.3f;
								if (j > num22 - 8)
								{
									float num27 = (float)(num22 - j) / 8f;
									num25 *= num27;
									num26 *= num27;
								}
								Color color2 = color * num25;
								Color color3 = color * num26;
								spriteBatch.Draw(this.waterfallTexture[12], position, new Rectangle?(value), color3, 0f, origin, 1f, SpriteEffects.None, 0f);
								spriteBatch.Draw(this.waterfallTexture[11], position, new Rectangle?(value2), color2, 0f, origin, 1f, SpriteEffects.None, 0f);
								if (flag)
								{
									break;
								}
								num14++;
								Tile tile = Main.tile[num13, num14];
								if (WorldGen.SolidTile(tile))
								{
									flag = true;
								}
								if (tile.liquid > 0)
								{
									int num28 = (int)(16f * ((float)tile.liquid / 255f)) & 254;
									if (num28 >= 15)
									{
										break;
									}
									value2.Height -= num28;
									value.Height -= num28;
								}
								if (num14 % 2 == 0)
								{
									position.X += 1f;
								}
								else
								{
									position.X -= 1f;
								}
								position.Y += 16f;
							}
							this.waterfalls[i].stopAtStep = 0;
						}
					}
				}
				IL_1879:
				i++;
				continue;
				IL_3FA:
开发者ID:NoviaDroid,项目名称:TerrariaRefractoring_1.3.2.1,代码行数:67,代码来源:WaterfallManager.cs

示例14: SolidTile

		public static bool SolidTile(Tile testTile)
		{
			try
			{
				if (testTile == null)
				{
					bool result = true;
					return result;
				}
				if (testTile.active() && Main.tileSolid[(int)testTile.type] && !Main.tileSolidTop[(int)testTile.type] && !testTile.halfBrick() && testTile.slope() == 0 && !testTile.inActive())
				{
					bool result = true;
					return result;
				}
			}
			catch
			{
			}
			return false;
		}
开发者ID:NoviaDroid,项目名称:TerrariaRefractoring_1.3.2.1,代码行数:20,代码来源:WorldGen.cs

示例15: 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


注:本文中的Terraria.Tile类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。