April 26 Group project progress

April 26 progress report

     Although there were individual assignments and pair assignments in the past few weeks, our group still met at least twice a week for two hours each time. But since we have entered the stage of writing code, the main task of the collection is to supervise each other and complete the tasks of the team project within 2 hours of the collection. The code is implemented according to the previous "code architecture", and the content that can be discussed is mainly specific technical issues.

 

rear end

     At present, the main parts of SessionManager, UserDB, MapChecker, GambleChecker and PlayerChecker have been roughly completed (the function is not guaranteed to be completely correct, which needs to be confirmed in the subsequent overall debugging), and it has entered the stage of writing unit tests. Since SkillsChecker is an add-on, it can be written separately after the whole is operational. The writing of GodActor is in progress.

     The special technique mainly used in unit testing is "Assert" (Assert) , if you use JUnit for unit testing, you must use assertions. If you write your own unit tests, you can not use it, but it is more convenient to use.

     The syntax for assertion is as follows:

assert expression : "Error Message";

 

     expression is an expression whose value is Boolean, and the following string is the error message thrown. In the assertion statement, the default value of expression is true. If the value of expression is false after running to this point, the program will Exit abnormally and display the following Error Message.

     E.g:

int i = 100;
i = i + 1;
assert i==100 : "i is not 100";

     The result of running this block is

Exception in thread "functionName" java.lang.AssertionError: Error Message
    at className1.functionName1(className.java:xx)
    at className2.functionName2(className.java:xx)

     The first line reports an error, telling the programmer that the program is abnormal. After the colon is the error message edited by the programmer in the assertion.

     The second line and the third line are the exception positions, which will tell the programmer where the exception occurred in which function of which class. If it is a nested call, it will be displayed from the inside to the outside until the outermost layer where the error is located. . In parentheses is the specific line number of the error report (xx is a number).

     It should be noted that assertions should not appear in the release version, so IDEA provides a very convenient function - enable/disable assertions, the default is off, the compilation can pass, but the assertion statement will not be executed. Do the following to enable assertions.

 

    Click "PlayerCheckerTest" in the figure (your current class name is displayed here), select "Edit Configurations" from the drop-down menu, and the dialog box below will pop up.

 

     Enter "-ea" in the red line in the figure.

    Enable it at development time, and disable it at release time, saving you the trouble of removing assert statements.

 

front end

     On the front-end side, since the previously written login and registration pages did not match the style of the game, the two front-end staff switched to the game-specific phaser framework to rewrite the front-end interface.

     phaser official website: http://www.phaser.io /

 

research

     In terms of research, game research is different from other projects. Players need to play the game before they can give feedback. Therefore, the game designers contacted the classmates of the board game club and used the board game version of the game to conduct among the board game club students. research. It is currently in progress.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324930589&siteId=291194637