Skip to content
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

Merged
merged 10 commits into from
Nov 26, 2024
Merged

Conversation

hyper2snyper
Copy link
Owner

#15 -This is already done, and more fixed.
#5 -Also done

Does #7
Map
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.

@hyper2snyper hyper2snyper added the build Runs build workflow label Nov 26, 2024
.gitignore Outdated
Comment on lines 4 to 5
Properties/Resources.resx
Copy link
Collaborator

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?

Copy link
Owner Author

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;");
Copy link
Collaborator

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.

Copy link
Owner Author

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.

Comment on lines 105 to 117
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++)
Copy link
Collaborator

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.

Copy link
Owner Author

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)

@andr3i-f andr3i-f added build Runs build workflow and removed build Runs build workflow labels Nov 26, 2024
@andr3i-f andr3i-f merged commit 3315027 into main Nov 26, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Runs build workflow
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement multithreading Random world generation Create internal database
2 participants