C
C#5mo ago
Frite

how can I avoid chaos like this ?

No description
12 Replies
Keswiik
Keswiik5mo ago
For starters, what are you trying to do? Because you could just check Keyboard.GetState().IsKeyDown(...) instead of trying to make a bunch of properties
Frite
FriteOP5mo ago
but what if i want proprerties ?
Saber
Saber5mo ago
Then deal with the mess
Pobiega
Pobiega5mo ago
at least capitalize them, and use the => expression syntax
Frite
FriteOP5mo ago
No description
Shawn
Shawn5mo ago
Why do you want properties?
Frite
FriteOP5mo ago
to turn this into this
No description
The Fog from Human Resources
But why :pwetty: Seems like lots of extra work for very little payoff
Frite
FriteOP5mo ago
i had enouth of copy+past i will allways keep it when i code
kurumi
kurumi5mo ago
don't forget other snippets included: multiple functions to change console colors (aka Console.SetRed() / Blue / Green / etc), get all processes in OS (aka Processes.Google / notepad / vscode / etc). it is super useless at least you can create extension method to avoid this boilerplate code or write custom SG
Angius
Angius5mo ago
public bool IsKey(Key k)
=> Keyboard.GetState().IsKeyDown(k);
public bool IsKey(Key k)
=> Keyboard.GetState().IsKeyDown(k);
if (IsKey(Key.A))
{

}
if (IsKey(Key.A))
{

}
Shorter, but no boilerplate
Want results from more Discord servers?
Add your server