本文整理汇总了TypeScript中Immutable.OrderedMap.forEach方法的典型用法代码示例。如果您正苦于以下问题:TypeScript OrderedMap.forEach方法的具体用法?TypeScript OrderedMap.forEach怎么用?TypeScript OrderedMap.forEach使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Immutable.OrderedMap
的用法示例。
在下文中一共展示了OrderedMap.forEach方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: updateArmies
public updateArmies(armies:OrderedMap<number, Army>) {
if (!armies||!armies.forEach) {
return;
}
this.armies = armies;
if (!this.terrain||!this.terrain.initialized) {
return;
}
if (this.armyMeshes) {
this.armyMeshes.forEach((armyMesh) => {
this.scene.remove(armyMesh);
this.meshFactory.disposeMesh(armyMesh);
});
}
this.armyMeshes = [];
this.armies.forEach((army) => {
let armyMesh:Mesh = this.meshFactory.createArmyMesh(army, this.getDisplayPosition(army.pos));
this.armyMeshes.push(armyMesh);
this.scene.add(armyMesh);
})
}
示例2: updateMovements
public updateMovements(movements:OrderedMap<number, List<Movement>>) {
if (!movements||!movements.forEach) {
return;
}
this.movements = movements;
if (!this.terrain||!this.terrain.initialized) {
return;
}
if (this.movementMeshes) {
this.movementMeshes.forEach((movementMesh) => {
this.scene.remove(movementMesh);
this.meshFactory.disposeMesh(movementMesh);
});
}
this.movementMeshes = [];
this.movements.forEach((movementList) => {
movementList.forEach((movement) => {
let movementMesh:Mesh = this.meshFactory.createMovementMesh(movement, this.getDisplayPosition(movement.from), this.getDisplayPosition(movement.to));
this.movementMeshes.push(movementMesh);
this.scene.add(movementMesh);
})
})
}