Add tracking assimilate attacking behaviot #39

Merged
MrKBear merged 13 commits from dev-mrkbear into master 2022-04-12 21:35:54 +08:00
3 changed files with 11 additions and 11 deletions
Showing only changes of commit 1b8f594ea2 - Show all commits

View File

@ -4,7 +4,7 @@ import { PhysicsDynamics } from "@Behavior/PhysicsDynamics";
import { Brownian } from "@Behavior/Brownian"; import { Brownian } from "@Behavior/Brownian";
import { BoundaryConstraint } from "@Behavior/BoundaryConstraint"; import { BoundaryConstraint } from "@Behavior/BoundaryConstraint";
import { Tracking } from "@Behavior/Tracking"; import { Tracking } from "@Behavior/Tracking";
import { Attacking } from "@Behavior/Attacking"; import { ContactAttacking } from "@Behavior/ContactAttacking";
const AllBehaviors: IAnyBehaviorRecorder[] = [ const AllBehaviors: IAnyBehaviorRecorder[] = [
new BehaviorRecorder(Template), new BehaviorRecorder(Template),
@ -12,7 +12,7 @@ const AllBehaviors: IAnyBehaviorRecorder[] = [
new BehaviorRecorder(Brownian), new BehaviorRecorder(Brownian),
new BehaviorRecorder(BoundaryConstraint), new BehaviorRecorder(BoundaryConstraint),
new BehaviorRecorder(Tracking), new BehaviorRecorder(Tracking),
new BehaviorRecorder(Attacking), new BehaviorRecorder(ContactAttacking),
] ]
/** /**

View File

@ -3,17 +3,17 @@ import { Group } from "@Model/Group";
import { Individual } from "@Model/Individual"; import { Individual } from "@Model/Individual";
import { Model } from "@Model/Model"; import { Model } from "@Model/Model";
type IAttackingBehaviorParameter = { type IContactAttackingBehaviorParameter = {
target: "CLG", target: "CLG",
success: "number", success: "number",
range: "number" range: "number"
} }
type IAttackingBehaviorEvent = {} type IContactAttackingBehaviorEvent = {}
class Attacking extends Behavior<IAttackingBehaviorParameter, IAttackingBehaviorEvent> { class ContactAttacking extends Behavior<IContactAttackingBehaviorParameter, IContactAttackingBehaviorEvent> {
public override behaviorId: string = "Attacking"; public override behaviorId: string = "ContactAttacking";
public override behaviorName: string = "$Title"; public override behaviorName: string = "$Title";
@ -54,8 +54,8 @@ class Attacking extends Behavior<IAttackingBehaviorParameter, IAttackingBehavior
public override terms: Record<string, Record<string, string>> = { public override terms: Record<string, Record<string, string>> = {
"$Title": { "$Title": {
"ZH_CN": "攻击", "ZH_CN": "接触攻击",
"EN_US": "Attacking" "EN_US": "Contact Attacking"
}, },
"$Target": { "$Target": {
"ZH_CN": "攻击目标", "ZH_CN": "攻击目标",
@ -76,4 +76,4 @@ class Attacking extends Behavior<IAttackingBehaviorParameter, IAttackingBehavior
}; };
} }
export { Attacking }; export { ContactAttacking };

View File

@ -131,8 +131,8 @@ class SimulatorWeb extends Component {
tracking.name = "Tracking"; tracking.color = [80, 200, 250]; tracking.name = "Tracking"; tracking.color = [80, 200, 250];
tracking.parameter.target.picker = fishLabel; tracking.parameter.target.picker = fishLabel;
let attacking = this.status.model.addBehavior(getBehaviorById("Attacking")); let attacking = this.status.model.addBehavior(getBehaviorById("ContactAttacking"));
attacking.name = "Attacking"; attacking.color = [120, 100, 250]; attacking.name = "Contact Attacking"; attacking.color = [120, 100, 250];
attacking.parameter.target.picker = fishLabel; attacking.parameter.target.picker = fishLabel;
fish1.addBehavior(dynamicFish); fish1.addBehavior(dynamicFish);