Commit d87f860d authored by unknown's avatar unknown

写配置表

parent 634ccff1
......@@ -175,7 +175,6 @@ export class FormulaSolitaireCtr extends Component {
let colorStr = this.curLinePointArr[0].target.getComponent(FormulaSolitaireItem)!.getColor();
let oldLine = this.findLineWithPoint(selPoint);
if (oldLine == null) {
console.log(`没有占有此点的线段`);
this.curLinePointArr.push(selPoint);
selPoint.target.getComponent(FormulaSolitaireItem)?.setColor(Color.fromHEX(new Color(), colorStr));
}
......@@ -230,6 +229,31 @@ export class FormulaSolitaireCtr extends Component {
console.log(this.allLinePointArr);
}
getResult(numStrArr: string[]){
let ret: any[] = [];
try{
let tempArr: string[] = [];
tempArr = tempArr.concat(numStrArr);
ret.push(this.calculator(tempArr));
}
catch{
console.log(`错误的算式1`);
ret.push(null);
}
try{
let tempArr: string[] = [];
tempArr = tempArr.concat(numStrArr);
tempArr = tempArr.reverse();
ret.push(this.calculator(tempArr));
}
catch{
console.log(`错误的算式2`);
ret.push(null);
}
return ret;
}
findLineWithPoint(point: ItemPosIfo) {
for (let i = 0; i < this.allLinePointArr.length; ++i) {
for (let j = 0; j < this.allLinePointArr[i].length; ++j) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment