This commit is contained in:
DESKTOP-5RP3AKU\Jisol
2023-10-24 02:32:06 +08:00
parent 77d44ee300
commit 72f3d7e880
26 changed files with 545 additions and 285 deletions

View File

@@ -62,15 +62,34 @@ export class GTactical{
//返回阵法位置
getPosition(index:number,father:Vec2 = v2(0,0)){
let pos;
if(pos = this.getXY(index)){
return father.clone().add(GTactical.pos[pos.y][pos.x].clone());
}
return null;
}
//返回XY
getXY(index:number):Vec2{
for(let i = 0;i < 3;i++){
for(let j = 0;j < 3;j++){
let tag = this.tactical[i][j];
if(tag == index){
return father.clone().add(GTactical.pos[i][j].clone());
return v2(j,i);
}
}
}
return null;
}
//返回我在第几排
getRow(index:number):number{
let pos;
if(pos = this.getXY(index)){
return pos.y;
}
return null;
}