C
C#6mo ago
Frite

how can I avoid chaos like this ?

No description
12 Replies
Keswiik
Keswiik6mo 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
FriteOP6mo ago
but what if i want proprerties ?
Saber
Saber6mo ago
Then deal with the mess
Pobiega
Pobiega6mo ago
at least capitalize them, and use the => expression syntax
Frite
FriteOP6mo ago
No description
Shawn
Shawn6mo ago
Why do you want properties?
Frite
FriteOP6mo 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
FriteOP6mo ago
i had enouth of copy+past i will allways keep it when i code
kurumi
kurumi6mo 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
Angius6mo 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