-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Random Terrain Generation and Client Communicator #27
Conversation
.gitignore
Outdated
Properties/Resources.resx |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still want these in our .gitignore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nope, ill fix that
|
||
void LoadTerrain() | ||
{ | ||
SQLiteDataReader results = DatabaseManager.ReadDB("SELECT * FROM Terrain;"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Later we should probably just have functions in the DatabaseManager that would be called instead of writing SQL so we can keep the SQL contained there, but for now it's fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The backend is going to be requesting and writing liberally, i don't want to have to be constantly making custom function wrappers in DB manager when i can just directly call it.
Backend/WorldData/Map.cs
Outdated
TerrainData selected_terrain = terrains[0]; //This is probably not very good. | ||
foreach(TerrainData d in terrains) | ||
{ | ||
if (height > d.heightMax || height < d.heightMin) continue; | ||
selected_terrain = d; | ||
break; | ||
} | ||
terrainMap[x, y] = selected_terrain; | ||
} | ||
|
||
public void GenerateImage() | ||
{ | ||
for(int x = 0; x < mapwidth; x++) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To keep things tidy we should have consistent variable name styling. Personally, I prefer camel case lettering, but I'm open for any type as long as it'd be consistent. In this highlighted section there is selected_terrain
, heightMin
and mapwidth
. Not a crazy big deal for now & we can work on going through this later to update the styling if need be.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i mix and match how i feel. consistency is for nerds. (Camel works)
#15 -This is already done, and more fixed.
#5 -Also done
Does #7
![Map](https://private-user-images.githubusercontent.com/43631032/389814740-9efbac43-a86e-40a8-aa84-a5194c1df195.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1NTkzNzIsIm5iZiI6MTczOTU1OTA3MiwicGF0aCI6Ii80MzYzMTAzMi8zODk4MTQ3NDAtOWVmYmFjNDMtYTg2ZS00MGE4LWFhODQtYTUxOTRjMWRmMTk1LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE0VDE4NTExMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTk5M2FiYzEwOTc5ZDY1NDEzMzNiNjQwYzY1ZTg3YTUxMDhmNDY4ODEzNDczYjc2NDYzYWM3YzUyMzc3ODI1MmEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.Bn2bODghuWFHh_4929kQmTesO-5VUxg248VG3hpneZA)
Very rudimentary but enough to divide and modify from here on out.
Also creates the Client Communicator, the device in which the frontend can call actions on the backend in an asynchronous way.