eDonnes124 / Town-Of-Us-R

An Among Us mod containing a bunch of roles
GNU General Public License v3.0
345 stars 140 forks source link

restructure all the hudmanagerupdate.cs and performkill.cs files alot of roles have #155

Closed whichtwix closed 4 months ago

whichtwix commented 1 year ago

many roles have 2 repeating files in the codebase, unifying them under 2 patchs may organize it better, and the roles that need it can override the virtual methods. Commonly there are 4 return statements at the top of the hudmanager patches that wont need repeating anymore and the role.getrole() in the overriden methods.

Also now the return statement relating to checking the role isnt needed since only the method for that role will be run. Im not sure if this is the case currently, but a crew role could be running all the patches that nuetrals and impostors have, and likewise for any other role, but it gets stopped at the returns, and with the changes, maybe itll shed some load of executing code

only did a few roles to show and test to make sure it went ok. This can be applied to the rest and some modifiers could be changed too, having their own patchs.