重构继承关系

This commit is contained in:
DESKTOP-5RP3AKU\Jisol
2023-11-01 02:01:35 +08:00
parent e59c5640d7
commit 6ebed0b45e
43 changed files with 496 additions and 524 deletions

View File

@@ -9,6 +9,9 @@ export class GTactical{
//阵容朝向
towards:GTowards;
//位置偏差
offset:Vec2;
//阵法位置
static pos:Vec2[][] = [
@@ -17,9 +20,15 @@ export class GTactical{
[v2(-100,-150),v2(0,-150),v2(100,-150)],
];
constructor(tactical:number[][],towards:GTowards = GTowards.RIGHT){
constructor(tactical:number[][],towards:GTowards = GTowards.RIGHT,offset:Vec2 = Vec2.ZERO){
this.tactical = tactical;
this.towards = towards;
this.offset = offset;
}
setOffset(offset:Vec2):this{
this.offset = offset;
return this;
}
//获取阵法
@@ -69,7 +78,7 @@ export class GTactical{
}
//返回阵法位置
getPosition(index:number,father:Vec2 = v2(0,0)){
getPosition(index:number,father:Vec2 = this.offset){
let pos;
if(pos = this.getXY(index)){