Skip to content

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

🔥


// 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