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

Improved GameObjects initialization, fixed the possibility to break GameObjects from outer assemblies, made prediction - related methods overridable in Spell.cs #96

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Wiciaki
Copy link

@Wiciaki Wiciaki commented Mar 7, 2016

No description provided.

@ghost
Copy link

ghost commented Mar 7, 2016

💯

@ghost
Copy link

ghost commented Mar 7, 2016

🔥

@@ -72,7 +73,7 @@ public static void Init(string[] args)
Logging.Write()(LogLevel.Info, "[SDK Bootstrap] Resources Initialized.");

// Load GameObjects.
GameObjects.Initialize();
RuntimeHelpers.RunClassConstructor(typeof(GameObjects).TypeHandle);
Copy link
Contributor

Choose a reason for hiding this comment

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

what?

Copy link
Author

Choose a reason for hiding this comment

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

This executes the .cctor if it hasn't already

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd rather not see any dirty reflection methods to achieve this.

Copy link
Author

Choose a reason for hiding this comment

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

How it this reflection or a dirty method?

@Wiciaki
Copy link
Author

Wiciaki commented Mar 7, 2016

There are essentially 2 approaches to expose the lists / public properties in GameObjects

  • A ReadOnlyCollection property created for every list existing in the class that returns a read only wrapper (what you see in my commit)
  • Just expose the plain list you are modifying within the class and hope nobody ever gets the idea to add / remove / clear stuff lol

The current IEnumerable approach is bad because it is slower to use and anyone can cast it back to List and do whatever he wants.

Just my 2 cents :roto2:

@ChewyMoon
Copy link
Contributor

Or just implement cache in the core :^)

@ghost
Copy link

ghost commented Mar 8, 2016

🍿

@ghost ghost assigned Esk0r Mar 8, 2016
@woin09 woin09 unassigned Esk0r Aug 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants