|
|
|
@ -1087,7 +1087,8 @@ function createDeckList(playerId){
|
|
|
|
item.push(itemCount);
|
|
|
|
item.push(itemCount);
|
|
|
|
// Set card data for new item
|
|
|
|
// Set card data for new item
|
|
|
|
// Use the ID from the deckList of player, and return the card of that ID from cardList/DB
|
|
|
|
// Use the ID from the deckList of player, and return the card of that ID from cardList/DB
|
|
|
|
cardData[itemCount] = cardArray[deckList[deckItem]];
|
|
|
|
// ID 1 was adding id 0 as array index. Changed to +1 for now (will correct in DB form)
|
|
|
|
|
|
|
|
cardData[itemCount] = cardArray[deckList[deckItem]+1];
|
|
|
|
// Set to base position of 'deck'
|
|
|
|
// Set to base position of 'deck'
|
|
|
|
boardElement[itemCount] = 'deck';
|
|
|
|
boardElement[itemCount] = 'deck';
|
|
|
|
// Set Attack, ManaCost, ManaColours TODO: When these are implemented seperately
|
|
|
|
// Set Attack, ManaCost, ManaColours TODO: When these are implemented seperately
|
|
|
|
@ -1313,12 +1314,18 @@ function getItemsAndPrintFrontEnd(){
|
|
|
|
if(cardStatusId == ""){ cardStatusId = null; }
|
|
|
|
if(cardStatusId == ""){ cardStatusId = null; }
|
|
|
|
let listPositionId = document.getElementById("listPositionId").value;
|
|
|
|
let listPositionId = document.getElementById("listPositionId").value;
|
|
|
|
if(listPositionId == ""){ listPositionId = null; }
|
|
|
|
if(listPositionId == ""){ listPositionId = null; }
|
|
|
|
getItemsAndPrint(boardElementId, playerId, cardStatusId, listPositionId);
|
|
|
|
let itemOrCard = document.getElementById("itemOrCardData").value;
|
|
|
|
|
|
|
|
getItemsAndPrint(boardElementId, playerId, cardStatusId, listPositionId, itemOrCard);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function getItemsAndPrint(boardElementId = null, playerId = null, cardStatusId = null, listPositionId = null){
|
|
|
|
function getItemsAndPrint(boardElementId = null, playerId = null, cardStatusId = null, listPositionId = null, itemOrCard = 'item'){
|
|
|
|
let items = board.getItems(boardElementId, playerId, cardStatusId, listPositionId);
|
|
|
|
let items = board.getItems(boardElementId, playerId, cardStatusId, listPositionId);
|
|
|
|
console.log('----- Items -----');
|
|
|
|
if(itemOrCard == 'card'){
|
|
|
|
printECSData(items);
|
|
|
|
console.log('----- CardData -----');
|
|
|
|
|
|
|
|
printCardData(items);
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
console.log('----- ItemData -----');
|
|
|
|
|
|
|
|
printECSData(items);
|
|
|
|
|
|
|
|
}
|
|
|
|
console.log('Items array length: '+items.length);
|
|
|
|
console.log('Items array length: '+items.length);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function printECSData(items){
|
|
|
|
function printECSData(items){
|
|
|
|
@ -1335,6 +1342,15 @@ function printECSData(items){
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function printCardData(items){
|
|
|
|
|
|
|
|
let cardArray = [];
|
|
|
|
|
|
|
|
for(let item = 0; item < items.length; item++){
|
|
|
|
|
|
|
|
let itemKey = items[item];
|
|
|
|
|
|
|
|
cardArray.push(cardData[itemKey]);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
console.log(cardArray);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
function echoCards(){
|
|
|
|
function echoCards(){
|
|
|
|
console.log(cardArray);
|
|
|
|
console.log(cardArray);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|