@@ -8,10 +8,11 @@ Methods to interact with the logout tab.
88{$ENDIF}
99
1010type
11+ ERSRating = (ONE, TWO, THREE, FOUR, FIVE);
1112 ERSLogoutButton = (WORLD_SWITCHER, CLICK_HERE);
1213 TRSLogout = record
1314 Buttons: array [ERSLoginButton] of TRSButton;
14- Ratings: array [0..4 ] of TRSButton;
15+ Ratings: array [ERSRating ] of TRSButton;
1516 end;
1617
1718procedure TRSLogout.SetupInterface();
@@ -85,13 +86,35 @@ WriteLn Logout.IsRated();
8586*)
8687function TRSLogout.IsRated(): Boolean;
8788begin
88- Result := Self.Ratings[0 ].Enabled();
89+ Result := Self.Ratings[ERSRating.ONE ].Enabled();
8990end;
9091
9192(*
92- ## Logout.ClickLogout
93+ ## Logout.Rate
9394```pascal
94- function TRSLogout.ClickLogout(attempts: Int32 = 5; time: Int32 = 20000): Boolean;
95+ function TRSLogout.Rate(const star: ERSRating): Boolean;
96+ ```
97+ Click a star button to rate the game.
98+
99+ Example:
100+ ```pascal
101+ WriteLn Logout.Rate(ERSRating.FOUR);
102+ ```
103+ *)
104+ function TRSLogout.Rate(const star: ERSRating): Boolean;
105+ begin
106+ if Self.Ratings[star].Enabled() and
107+ ((star = ERSRating.FIVE) or not Self.Ratings[star+1].Enabled()) then
108+ Exit(True);
109+
110+ Self.Ratings[star].Click(EMouseButton.LEFT);
111+ Result := Self.Ratings[star].WaitEnabled();
112+ end;
113+
114+ (*
115+ ## Logout.Logout
116+ ```pascal
117+ function TRSLogout.Logout(attempts: UInt32 = 5; time: UInt32 = 20000): Boolean;
95118```
96119Clicks the logout button. Returns true if we succesfully logout of the game.
97120
@@ -115,7 +138,7 @@ begin
115138 else
116139 i := RandomLeft(0, 4);
117140
118- WriteLn GetDebugLn('Logout', 'Rating the game with ' + ToStr(i+1 ) + ' stars before logging out.');
141+ WriteLn GetDebugLn('Logout', 'Rating the game with ' + ToStr(ERSRating(i) ) + ' stars before logging out.');
119142 Self.Ratings[i].Enable();
120143 end;
121144
0 commit comments