本文整理匯總了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);
})
})
}