Beiträge von kim366

    Ich verfasse diesen Post auf Englisch, weil mir das leichter fällt (ja, meine Muttersprache ist Deutsch). Falls Ihr lieber auf Deutsch antwortet, tut dies. I have no idea what the right word for this is. Is it structure? Paradigm? Strategy?

    I have the following struct:

    All the properties are being updated every frame. The variable name

    Code
    buttonPressedThisFrame

    is extremely long, so I have shortened it to

    Code
    bptf

    since it is commented at the declaration anyways. Is this the correct thing to do?

    I also have a function, which is called every frame, called

    Code
    void handleInput(o::Mouse m)

    which surprisingly enough handles all the input. The project I am currently working on has to do with nodes and mouse controls are there for the selection and moving of said nodes. So in that function I have a few if-statements. Is it better to have completely dry code and only have every if-statement once, or is it better to logically separate them?

    Examle:

    vs

    What is to be said about my project, is that those if-statements become quite nested (up to 6 tabstops with else-statements to each of them) and also cover keyboard input combined with mouse input (e.g. Ctrl + LMB).

    Which of these strategies is the correct/best one to use?