Архитектурный шаблон "Мрак в моделях" на нескольких языках и платформах
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

memoryItemPositions.js 451B

пре 1 година
1234567891011121314151617
  1. var Position = /** @class */ (function () {
  2. function Position(x, y) {
  3. this.x = x;
  4. this.y = y;
  5. }
  6. return Position;
  7. }());
  8. function memoryItemPositions(c) {
  9. var pos = [];
  10. for (var i = 0; i < c.itemsCount; i++) {
  11. var row = Math.floor(i / 4);
  12. var x = memoryGap() + (i - row * 4) * memoryGap();
  13. var y = memoryGap() + row * memoryGap();
  14. pos.push(new Position(x, y));
  15. }
  16. return pos;
  17. }