Wpf System test

This commit is contained in:
Troispoils 2024-03-06 17:19:53 +01:00
parent af9c782c1e
commit 9ad4bc1c69
17 changed files with 746 additions and 12 deletions

View file

@ -0,0 +1,40 @@
using LandblockExtraction.WorldMap.Types;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Numerics;
using System.Threading.Tasks;
namespace LandblockExtraction.WorldMap;
public class WorldMap {
public Land[,] lands;
public WorldMap() {
lands = new Land[10, 10];
CreatePlane();
}
public void CreatePlane() {
for(int i = 0; i < 10; i++) {
for(int j = 0; j < 10; j++) {
lands[j,i] = CreateCell(i, j);
}
}
}
private Land CreateCell(int i, int j) {
Land land = new Land();
for(int y = 0; y < 17; y++) {
for (int x = 0; x < 17; x++) {
float rand = new Random().Next(0, 254) / 255f;
Console.WriteLine(rand);
land.cell.position[x, y] = new Vector3(x + (j * 9), 0, y + (i * 9));
land.cell.color[x, y] = new Vector4(rand, rand, rand, 1f);
}
}
return land;
}
}