Menu

#70 Codecleanup - Gamedata

Room Scripts
fixed
Scripting (65)
2014-11-21
2014-11-17
No

The "GameData" script is vast and covers a range of topics. All the functions in this script could easily be divided into lesser scripts to make things more managable.

  • All structs/enums and related functions should be put in individual Scripts with same names as the structs/enums.
    • TimerType and TimeData would go nicely being put in the same folder as Time
    • HeroData and Statistics have same type of functionality, so they should probably be merged.
  • Math functions should be put in a separate script "Utilities/Math"
  • The function ExitGame only has one line of code, and is not used consistently throughout the project. It should be removed.
  • InitializeClasses should be an extension of HeroData
  • All running/sneak/etc code should be put in a separate script "HeroMovement"
  • recallCursorModes should be put in the script "Mouse" as an extender function
  • "Utility" code should be put into "Utilities/Utilities"
  • Commented code or code that doesn't do anything should be removed

There is more, but I'm going to have to ask people to use their best judgement for the topics I haven't already mentioned. Since this is a Script with functionality that is being heavily used through the rest of the code it is likely it is impossible to find "neat" locations for all them at the first try. As such we'll have to make this an iterative process where we try to clean some up as much as we can, come back later and continue cleaning this script and possibly new scripts that diverged from it.

Discussion

  • Per Olav Flaten

    Per Olav Flaten - 2014-11-18
    • status: open --> accepted
     
  • Per Olav Flaten

    Per Olav Flaten - 2014-11-18
    • assigned_to: Per Olav Flaten
     
  • Robert Kety

    Robert Kety - 2014-11-21
    • status: accepted --> fixed
     

Log in to post a comment.

MongoDB Logo MongoDB