mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-12-09 06:19:07 +00:00
重构继承关系
This commit is contained in:
@@ -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)){
|
||||
|
||||
Reference in New Issue
Block a user