07-11-2012, 01:55 AM
I got another idea
I think it´s the best to use this thread, because it´s the right topic.
Always when I want to do something with Placing Blocks, Right Clicking action, I start getting a headache, because it´s so messed up.
Everything is inside the cClientHandle Class / Inside the specific Handle function.
My idea would be to "outsource" everything a bit.
We could create some RightClickHandlers / LeftClickHandlers, we call in the right order.
So we don´t have everything in one function. (Placing Doors next to the food code, then the bucket code, the slab code and so on)
Wouldn´t it be cool to split it into multiple classes/functions. This would make everything much clearer, because you don´t have to scroll over hundred lines of code.
If we would keep the Handlers hardcoded in the clienthandle we wouldn´t have a big performance loss. (One function call more)
I would implement this, but I would like to hear your opinion first.
Simon
I think it´s the best to use this thread, because it´s the right topic.
Always when I want to do something with Placing Blocks, Right Clicking action, I start getting a headache, because it´s so messed up.
Everything is inside the cClientHandle Class / Inside the specific Handle function.
My idea would be to "outsource" everything a bit.
We could create some RightClickHandlers / LeftClickHandlers, we call in the right order.
So we don´t have everything in one function. (Placing Doors next to the food code, then the bucket code, the slab code and so on)
Wouldn´t it be cool to split it into multiple classes/functions. This would make everything much clearer, because you don´t have to scroll over hundred lines of code.
If we would keep the Handlers hardcoded in the clienthandle we wouldn´t have a big performance loss. (One function call more)
I would implement this, but I would like to hear your opinion first.
Simon