Top Comments

NeatCrown
NeatCrown Moderator

in reply to lecorbak

That… doesn't make a lot of sense, to be honest. The `exe` executable file is a windows binary that runs the engine. The actual game code itself is stored inside the Assembly-CSharp.dll file. There are compiler optimizations, but that should make things more, not less efficient.

It's been a few years since I last looked at it in 2020, so here are some snippets.

There's no reason it should be that complex. The following would be a much shorter way to do it, but it's still not the best. In reality, the best way to do it would probably be using DateTime formatting with languages and locales, but ignoring that, this would still be a better choice than what is (was?)

public string GetWeekdayText(DayOfWeek weekday)
{
    return weekday.ToString().ToUpper();
}

Another example:

This doesn't even make any sense. Even ignoring the bad example, there is absolutely no reason to set life/death state every frame. The best way to do it would be by calling a death function a single time.

if(health <= 0)
  Die();
+5

+ Add a Comment

Comments (9)


Display Comments

Add a Comment


Yo Yo! You must login or signup first!