First issue:¶
Here is how you can look at the problem:
- checkout branch Limes
- start the test system with F5 and log in as test user
- start a new game "Limes". You can choose 1 player, this is enough for this test.
- start the game - you should see the gui as shown under documents
- start the debugger with F12 and open the file activate.js
- In activate.js set a breakpoint in lines Zeile 23 und 29
- In VS Studio search the class BaseLogic.cs und set a breakpoint in lines 327 and 1538
- Click "ja" or "nein" in the small window in the GUI. You will get an error in both cases (screenshot in documents)
- I am afraid the Tuple in the class PlayCardDecision (line 27) is not assignable from JavaScript. Before I refactor everything, I want to check this by experienced programmers.
Possible solution:¶
the correct call would look like this:
y$.service.makeDecision([{Item1: 0, Item2: 2}, 1]);
Generally it is recommende that GenerateDecisionData returns a List of possible parameters and nothing else. This could be made like this:
function PlayCard(action, params) {
y$.service.makeDecision(params[0]);
}
so simply choose an element from the List of parameters got from the server. Of course there can be reasons to differ from this, e. g. if you use this:
https://yucata.de/redmine/projects/developer_wiki/wiki/Adding_Simultaneous_Turns_to_your_game#Optional-Feature-Generate-Partial-Decision-Data
Apart from that it is recommended to replace the Tuple with a
class Coordinate{
[JsonProperty("X")]
public int X { get; set; }
[JsonProperty("Y")]
public int Y { get; set; }
}
or sth. similar. This makes all better readable.