d
This commit is contained in:
@@ -5,7 +5,6 @@ var Position = /** @class */ (function () {
|
||||
}
|
||||
return Position;
|
||||
}());
|
||||
// @ts-nocheck
|
||||
function memoryItemPositions(c) {
|
||||
var pos = [];
|
||||
for (var i = 0; i < c.itemsCount; i++) {
|
||||
|
||||
@@ -1,11 +1,25 @@
|
||||
// @ts-nocheck
|
||||
func memoryItemPositions(c: Context) -> [Position] {
|
||||
var pos = [Position]
|
||||
protocol Context {
|
||||
var itemsCount: Float { get }
|
||||
|
||||
}
|
||||
|
||||
class Position {
|
||||
x: Float
|
||||
y: Float
|
||||
|
||||
constructor(x, y) {
|
||||
this.x = x
|
||||
this.y = y
|
||||
}
|
||||
}
|
||||
|
||||
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))
|
||||
pos.push(new Position(x, y))
|
||||
}
|
||||
return pos
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ FILES=(
|
||||
)
|
||||
|
||||
for file in ${FILES[*]}; do
|
||||
tsc $SCRIPT_DIR/$file.ts --outfile $SCRIPT_DIR/JavaScript/$file.js
|
||||
$SCRIPT_DIR/../toSwift $SCRIPT_DIR/$file.ts $SCRIPT_DIR/Swift/$file.swift
|
||||
tsc $SCRIPT_DIR/$file.ts --outfile $SCRIPT_DIR/JavaScript/$file.js
|
||||
done
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@ class Position {
|
||||
}
|
||||
}
|
||||
|
||||
// @ts-nocheck
|
||||
function memoryItemPositions(c: Context): Position[] {
|
||||
var pos: Position[] = []
|
||||
for (var i = 0; i < c.itemsCount; i++) {
|
||||
|
||||
Reference in New Issue
Block a user