mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-27 02:36:14 +00:00
update
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user