I'm in my games JS file. I have built a function that will react when someone clicks a card. When clicked I am printing to the console my hand and the results of getSelectedItems:
console.log(this.gamedatas.hand);
console.log(this.playerHand.getSelectedItems());
The problem is that they don't match. The card IDs do but not the types. I selected the 8 of Diamonds. So I get this in my hand printout:
{id: "3", type: "4", type_arg: "8", location: "hand", location_arg: "2300762"}
and I get this from the selected items:
{id: "3", type: 45}
So the IDs match with the 3 but why would I get a type of 45 from the getSelectedItems function ? I'm confused as to what this is and the wiki isn't super helpful as it simply says that this function "Return the list of selected items, as an array with the following format" and shows ids and types. This seems super odd.
I need to know what card is being selected by suit and number. Is there a way in the JS file to do this? I can see how I would do it with the deck library used in the game.php file with getCard but how can this be done from the JS file?
Sorry again if this is a very basic thing and I'm simply not catching what should happen.
console.log(this.gamedatas.hand);
console.log(this.playerHand.getSelectedItems());
The problem is that they don't match. The card IDs do but not the types. I selected the 8 of Diamonds. So I get this in my hand printout:
{id: "3", type: "4", type_arg: "8", location: "hand", location_arg: "2300762"}
and I get this from the selected items:
{id: "3", type: 45}
So the IDs match with the 3 but why would I get a type of 45 from the getSelectedItems function ? I'm confused as to what this is and the wiki isn't super helpful as it simply says that this function "Return the list of selected items, as an array with the following format" and shows ids and types. This seems super odd.
I need to know what card is being selected by suit and number. Is there a way in the JS file to do this? I can see how I would do it with the deck library used in the game.php file with getCard but how can this be done from the JS file?
Sorry again if this is a very basic thing and I'm simply not catching what should happen.