Skip to content
This repository has been archived by the owner on Aug 9, 2018. It is now read-only.

Further Code Clean Up #12

Merged
merged 8 commits into from
Aug 20, 2017
Merged

Further Code Clean Up #12

merged 8 commits into from
Aug 20, 2017

Conversation

MartinX3
Copy link
Contributor

@MartinX3 MartinX3 commented Aug 7, 2017

Added ToDo's

Fixed moons-String.

Optimized Code further (C#7 conventions)

Changed some code to LINQ

MartinX3 and others added 5 commits August 6, 2017 14:10
Added ToDo's
Added ToDo's
Fixed moons-String.

Added ToDo's
Changed some code to LINQ
namespace Stellarator.Database
{
using ConfigNodeParser;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please leave the usings outside of the namespace declaration.

/// <summary>
/// Prefab for a PQS
/// Prefab for a PQS
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure if I like these leading whitespaces.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I revert this?
I thought with them, the text between the next nodes is easier to read. :)

/// </summary>
public static Int32 Seed { get; set; }
private static int Seed { get; set; }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use CLR type names instead of type aliases

{
// Log
Console.WriteLine("Generating the solar system...");
Console.WriteLine();

// Create a new Solar System using libaccrete
SolarSystem system = new SolarSystem(false, true, s => { });
SolarSystem.Generate(ref system, seed.GetHashCode(), Int32.MaxValue);
var system = new SolarSystem(false, true, s => { });
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't use var.

else
{
template.AddValue("name", Utility.GetTemplate(planet.surface_pressure > 0.00001, false));
template.AddValue("removeAllPQSMods", "True");
template.AddValue("removeAllPQSmods", "True");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You know that you changed a value that is later read by Kopernicus? Kopernicus is case sensitive

Color average = default(Color);
GeneratePQS(ref node, name, folder, planet, ref average);
Color average;
GeneratePqs(ref node, name, folder, planet, out average);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please keep it PQS


// Create a node for the mods
ConfigNode mods = new ConfigNode("Mods");
var mods = new ConfigNode("mods");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above, you changed a value that is later read by Kopernicus

{
// Create a VertexBuildData
var builddata = new VertexBuildData
{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This indent looks weird

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ReSharper told it to me, for a better readability
Should i revert it?

// Save the textures
Directory.CreateDirectory(Directory.GetCurrentDirectory() + "/systems/" + folder + "/PluginData/");
using (var normals = Utility.BumpToNormalMap(height, 9)
) // TODO: Implement something to make strength dynamic
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No newline maybe?

Copy link
Contributor Author

@MartinX3 MartinX3 Aug 17, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The newline intends a better reading
Should I revert it?

diffuse.Bitmap
       .Save(Directory.GetCurrentDirectory() + "/systems/" + folder + "/PluginData/" + name + "_Texture.png",
             ImageFormat.Png);

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the code I marked, there is a new line for a ), I don't think that is neccessary. The comment can stay on the new line though.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh, It is changed. :)

"Please leave the usings outside of the namespace declaration." in Database

"Please use CLR type names instead of type aliases"

"Please don't use var."

"You know that you changed a value that is later read by Kopernicus? Kopernicus is case sensitive" D: Sorry

"Please keep it PQS"

"Same as above, you changed a value that is later read by Kopernicus" D: Still sorry D:
@MartinX3
Copy link
Contributor Author

MartinX3 commented Aug 17, 2017

I made several commits to integrate your advises
I look how I can merge them with this pull request.

Edit:
Oh, they are automatically integrated. Nice.
@StollD may you look at this?

var seed = Prompt("Please enter the seed you want to use: ", "--seed");
var folder = Prompt("Please choose a folder name for your system: ", "--name");
var systematic = Prompt("Use systematic planet names? (y/n) ", "--systematic", true);
string seed = Prompt("Please enter the seed you want to use: ", "--seed");
Copy link
Member

@StollD StollD Aug 18, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use CLR type names here too (and everywhere else)

@MartinX3
Copy link
Contributor Author

Hey @StollD , is that okay now? :)

…t is neccessary. The comment can stay on the new line though."

- Added a info about the code conventions.
@MartinX3
Copy link
Contributor Author

I also added an Info about the code conventions, you want in this project. :)

@StollD
Copy link
Member

StollD commented Aug 20, 2017

Looks ok to me. Merging.

Thanks for your contribution!

@MartinX3
Copy link
Contributor Author

Perfect :)
And I'm glad, that you are happy about my contribution :D

@StollD StollD merged commit 7dccb0d into Kopernicus:master Aug 20, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants