void MapLoad(string filelocation)
{
string[] map_;
string line = File.ReadAllText(filelocation);//
map_ = line.Split(new char[] { ',', ';', '(', ')' }, StringSplitOptions.RemoveEmptyEntries);
for (int xj = 0; xj < map_.Length; xj += 5)
{
// Here xj is an index of a X coordinate, xj + 1 is an index of a Y coordinate, xj + 2 is an index of a Z coordinate
//object for storing the data
Block_ chunk_block = new Block_();
//coordinates set
chunk_block.set_v1(new Vector3(Int32.Parse(map_[xj]), Int32.Parse(map_[xj + 1]), Int32.Parse(map_[xj + 2])));
//material set
chunk_block.set_v1_material(Int32.Parse(map_[xj + 3]));//1
//block type set
chunk_block.set_v1_blocktype(Int32.Parse(map_[xj + 4]));
chunk_block.set_v1_scale(new Vector3(1, 1, 1));
stuff__.block_file.Add(chunk_block);
stuff__.collision.Add(chunk_block.get_v1());
}
}
void MapLoad(string filelocation)
{
string[] map_;
string line = File.ReadAllText(filelocation);//
map_ = line.Split(new char[] { ',', ';', '(', ')' }, StringSplitOptions.RemoveEmptyEntries);
for (int xj = 0; xj < map_.Length; xj += 5)
{
// Here xj is an index of a X coordinate, xj + 1 is an index of a Y coordinate, xj + 2 is an index of a Z coordinate
//object for storing the data
Block_ chunk_block = new Block_();
//coordinates set
chunk_block.set_v1(new Vector3(Int32.Parse(map_[xj]), Int32.Parse(map_[xj + 1]), Int32.Parse(map_[xj + 2])));
//material set
chunk_block.set_v1_material(Int32.Parse(map_[xj + 3]));//1
//block type set
chunk_block.set_v1_blocktype(Int32.Parse(map_[xj + 4]));
chunk_block.set_v1_scale(new Vector3(1, 1, 1));
stuff__.block_file.Add(chunk_block);
stuff__.collision.Add(chunk_block.get_v1());
}
}
//version for position
void MapLoad(string filelocation,Vector3 position)
{
string[] map_;
string line = File.ReadAllText(filelocation);//
map_ = line.Split(new char[] { ',', ';', '(', ')' }, StringSplitOptions.RemoveEmptyEntries);
for (int xj = 0; xj < map_.Length; xj += 5)
{
// Here xj is an index of a X coordinate, xj + 1 is an index of a Y coordinate, xj + 2 is an index of a Z coordinate
Block_ chunk_block = new Block_();
chunk_block.set_v1(new Vector3(Int32.Parse(map_[xj])+position.X, Int32.Parse(map_[xj + 1]) + position.Y, Int32.Parse(map_[xj + 2]) + position.Z));
chunk_block.set_v1_material(Int32.Parse(map_[xj + 3]));//1
chunk_block.set_v1_blocktype(Int32.Parse(map_[xj + 4]));
chunk_block.set_v1_scale(new Vector3(1, 1, 1));
stuff__.block_file.Add(chunk_block);
stuff__.collision.Add(new Vector3(chunk_block.get_v1().X, chunk_block.get_v1().Y+1, chunk_block.get_v1().Z));
}
}
heres rendering
for (int i = 0; i < stuff__.block_file.Count; i++)
{
//block data given to block model object that takes material for textures etc but thats not about problem
block(new Vector3(stuff__.block_file[i].get_v1().X, stuff__.block_file[i].get_v1().Y-2 + walking__, stuff__.block_file[i].get_v1().Z), stuff__.block_file[i], BeginMode.Quads, stuff__.block_file[i].get_v1_scale());
}
input data looks like (x,y,z),material,blocktype (x,y,z),material,blocktype..
scale does not need stored on file due its not implemented
void MapLoad(string filelocation,Vector3 position)
{
string[] map_;
string line = File.ReadAllText(filelocation);//
map_ = line.Split(new char[] { ',', ';', '(', ')' }, StringSplitOptions.RemoveEmptyEntries);
for (int xj = 0; xj < map_.Length; xj += 5)
{
// Here xj is an index of a X coordinate, xj + 1 is an index of a Y coordinate, xj + 2 is an index of a Z coordinate
Block_ chunk_block = new Block_();
//position
chunk_block.set_v1(new Vector3(Int32.Parse(map_[xj])+position.X, Int32.Parse(map_[xj + 1]) + position.Y, Int32.Parse(map_[xj + 2]) + position.Z));
//mat
chunk_block.set_v1_material(Int32.Parse(map_[xj + 3]));//1
//blocktype
chunk_block.set_v1_blocktype(Int32.Parse(map_[xj + 4]));
chunk_block.set_v1_scale(new Vector3(1, 1, 1));
stuff__.block_file.Add(chunk_block);
stuff__.collision.Add(new Vector3(chunk_block.get_v1().X, chunk_block.get_v1().Y+1, chunk_block.get_v1().Z));
}
}
heres rendering
for (int i = 0; i < stuff__.block_file.Count; i++)
{
//block data given to block model object that takes material for textures etc but thats not about problem
block(new Vector3(stuff__.block_file[i].get_v1().X, stuff__.block_file[i].get_v1().Y-2 + walking__, stuff__.block_file[i].get_v1().Z), stuff__.block_file[i], BeginMode.Quads, stuff__.block_file[i].get_v1_scale());
}
input data looks like (x,y,z),material,blocktype (x,y,z),material,blocktype..
scale does not need stored on file due its not implemented
```