Inheritance: XCom.Interfaces.Base.ITile
コード例 #1
0
ファイル: XCTile.cs プロジェクト: pmprog/OpenXCOM.Tools
		public XCTile(int id,PckFile file, McdEntry info,McdFile mFile):base(id)
		{
			this.info = info;
			myFile = file;
			mcdFile = mFile;

			image = new PckImage[numImages];	
	
			if(!info.UFODoor && !info.HumanDoor)
				MakeAnimate();
			else
				StopAnimate();

			dead =null;
			alternate = null;
		}
コード例 #2
0
ファイル: McdFile.cs プロジェクト: pmprog/OpenXCOM.Tools
//		internal McdFile(string basename, string directory)
//		{
//			BufferedStream file = new BufferedStream(File.OpenRead(directory+basename+".MCD"));
//			int diff = 0;
//			if(basename == "XBASES05")
//				diff=3;
//			tiles = new Tile[(file.Length/62)-diff];
//			PckFile f = GameInfo.GetPckFile(basename,directory,2);
//			for(int i=0;i<tiles.Length;i++)
//			{
//				byte[] info = new byte[62];
//				file.Read(info,0,62);
//				tiles[i] = new Tile(i,f,new McdEntry(info),this);
//			}
//
//			foreach(Tile t in tiles)
//				t.Tiles = tiles;
//			file.Close();
//		}

		internal McdFile(string basename, string directory, PckFile f)
		{
			BufferedStream file = new BufferedStream(File.OpenRead(directory+basename+".MCD"));
			int diff = 0;
			if(basename == "XBASES05")
				diff=3;
			tiles = new XCTile[(((int)file.Length)/62)-diff];
	
			for(int i=0;i<tiles.Length;i++)
			{
				byte[] info = new byte[62];
				file.Read(info,0,62); 
				tiles[i] = new XCTile(i,f,new McdEntry(info),this);
			}

			foreach(XCTile t in tiles)
				t.Tiles = tiles;
			file.Close();
		}
コード例 #3
0
ファイル: MapTile.cs プロジェクト: pmprog/OpenXCOM.Tools
		private void calcTiles()
		{
			int notNull = 0;
			maxSub = -255;
			if (ground != null)
			{
				notNull++;
				maxSub = ground.Info.TileOffset;
				standOffset = ground.Info.StandOffset;
			}
			if (north != null)
			{
				notNull++;
				maxSub = Math.Max(maxSub, north.Info.TileOffset);
				standOffset = Math.Max(standOffset, north.Info.TileOffset);
			}
			if (west != null)
			{
				notNull++;
				maxSub = Math.Max(maxSub, west.Info.TileOffset);
				standOffset = Math.Max(standOffset, west.Info.TileOffset);
			}
			if (content != null)
			{
				notNull++;
				maxSub = Math.Max(maxSub, content.Info.TileOffset);
				standOffset = Math.Max(standOffset, content.Info.TileOffset);
			}

			usedTiles = new XCTile[notNull];
			int space = 0;

			if (ground != null)
				usedTiles[space++] = ground;
			if (north != null)
				usedTiles[space++] = north;
			if (west != null)
				usedTiles[space++] = west;
			if (content != null)
				usedTiles[space++] = content;
		}