C# static classes | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

C# static classes

So while writing a game engine I have noticed that I repeat a lot of code, mostly functions like Translate, Rotate etc wouldn't it be more efficient if I would just place all of the functions in a static class, and also should I separate some of the functions into different static classes so that I'm using fewer features to use as little memory - I'm not sure if the clr just stores the pointer to the function of the entity so it's not replicated as more entities are added to the scene.

4th Mar 2017, 12:58 PM
Edwin Rybarczyk
1 Answer
0
it should be more efficient if you use funtions, about the clr, yes its only store to that entity Ex: p1: have an allocation if you add more entities each have their allocation
6th Mar 2017, 7:49 AM
Richard D. Casado A.
Richard D. Casado A. - avatar