1 decade ago by Mario
				hello, i am trying to create a simple ki.
my game flow is something like that:
iam stuck at save and restore ig.game.entities...
checkRules change some entities (if action cards activated) and after the first simulation the entities are at a wrong state for the next simulation
i tried $.extend(true, {}, ig.game.entities); from jquery and a self written recursive solution, because ig.Array.copy should not work with ig.Classes
has anyone a hint for me? i will write further explaination if necessary...
thx mario
		my game flow is something like that:
if (currentPlayer == human) {
 var card = letHimPickACard();
 checkRules(card);
} else {
  for(var i=0; i< allPossibilities; i++) {
    saveEntities();
    var card = getCard[i];
    checkRules(card);
    if(points >= bestPoints) {
       bestPoints = points;
       bestChoice = i;
    }
    restoreEntities;
  }
  var card = getCard[bestChoice];
  checkRules(card);
}
iam stuck at save and restore ig.game.entities...
checkRules change some entities (if action cards activated) and after the first simulation the entities are at a wrong state for the next simulation
i tried $.extend(true, {}, ig.game.entities); from jquery and a self written recursive solution, because ig.Array.copy should not work with ig.Classes
has anyone a hint for me? i will write further explaination if necessary...
thx mario
