Михаил Капелько 1年前
父节点
当前提交
19025d4c13
共有 8 个文件被更改,包括 66 次插入14 次删除
  1. 二进制
      iOS/app/MMMemory.xcodeproj/project.xcworkspace/xcuserdata/mk.xcuserdatad/UserInterfaceState.xcuserstate
  2. +18
    -0
      shared/JavaScript/memoryItemPositions.js
  3. +11
    -0
      shared/Swift/memoryItemPositions.swift
  4. +1
    -0
      shared/gen
  5. +25
    -0
      shared/memoryItemPositions.ts
  6. +3
    -14
      web/memory.html
  7. +4
    -0
      будущее
  8. +4
    -0
      прошлое

二进制
iOS/app/MMMemory.xcodeproj/project.xcworkspace/xcuserdata/mk.xcuserdatad/UserInterfaceState.xcuserstate 查看文件


+ 18
- 0
shared/JavaScript/memoryItemPositions.js 查看文件

@@ -0,0 +1,18 @@
var Position = /** @class */ (function () {
function Position(x, y) {
this.x = x;
this.y = y;
}
return Position;
}());
// @ts-nocheck
function memoryItemPositions(c) {
var pos = [];
for (var i = 0; i < c.itemsCount; i++) {
var row = Math.floor(i / 4);
var x = memoryGap() + (i - row * 4) * memoryGap();
var y = memoryGap() + row * memoryGap();
pos.push(new Position(x, y));
}
return pos;
}

+ 11
- 0
shared/Swift/memoryItemPositions.swift 查看文件

@@ -0,0 +1,11 @@
// @ts-nocheck
func memoryItemPositions(c: Context) -> [Position] {
var pos = [Position]
for (var i = 0; i < c.itemsCount; i++) {
let row = Math.floor(i / 4)
let x = memoryGap() + (i - row * 4) * memoryGap()
let y = memoryGap() + row * memoryGap()
pos.push(Position(x, y))
}
return pos
}

+ 1
- 0
shared/gen 查看文件

@@ -4,6 +4,7 @@ SCRIPT_DIR=$(cd "$(dirname "$0")" ; pwd -P)

FILES=(
memoryGap
memoryItemPositions
memorySide
memorySpace
)


+ 25
- 0
shared/memoryItemPositions.ts 查看文件

@@ -0,0 +1,25 @@
interface Context {
itemsCount: number
}

class Position {
x: number
y: number
constructor(x, y) {
this.x = x
this.y = y
}
}

// @ts-nocheck
function memoryItemPositions(c: Context): Position[] {
var pos: Position[] = []
for (var i = 0; i < c.itemsCount; i++) {
let row = Math.floor(i / 4)
let x = memoryGap() + (i - row * 4) * memoryGap()
let y = memoryGap() + row * memoryGap()
pos.push(new Position(x, y))
}
return pos
}

+ 3
- 14
web/memory.html 查看文件

@@ -6,20 +6,9 @@
<body>
</body>
<script src="../shared/JavaScript/memoryGap.js"></script>
<script src="../shared/JavaScript/memoryItemPositions.js"></script>
<script src="../shared/JavaScript/memorySide.js"></script>
<script src="../shared/JavaScript/memorySpace.js"></script>
<script>
function memoryItemPositions(M) {
var pos = []
for (var i = 0; i < M.itemsCount; i++) {
let row = Math.floor(i / 4)
let x = memoryGap() + (i - row * 4) * memoryGap()
let y = memoryGap() + row * memoryGap()
pos.push([x, y])
}
return pos
}
</script>
<script>
var items = []

@@ -39,8 +28,8 @@
for (var id in positions) {
var p = positions[id]
var item = items[id];
item.style.left = `${p[0]}px`
item.style.top = `${p[1]}px`
item.style.left = `${p.x}px`
item.style.top = `${p.y}px`
item.style.width = `${memorySide()}px`
item.style.height = `${memorySide()}px`
item.style.position = "absolute"


+ 4
- 0
будущее 查看文件

@@ -1,5 +1,9 @@

НАДО:
* генерить interface в Swift
* генерить class в Swift
* нет struct, к сожалению
* генерить memoryItemPositions.swift
* генерить библиотеку на основе иных replacements
* ввести общую библиотеку
* генерить itemPositions

+ 4
- 0
прошлое 查看文件

@@ -1,4 +1,8 @@

02.06: 20

* геренить memoryItemPositions.js

01.06: 40

* сообщать Usage


正在加载...
取消
保存