fixed bugs
This commit is contained in:
parent
193e884e40
commit
c0a23c31f7
6 changed files with 20 additions and 33 deletions
|
@ -1,23 +1,13 @@
|
|||
import {
|
||||
IsArray,
|
||||
IsEnum,
|
||||
IsNotEmpty,
|
||||
IsObject,
|
||||
IsOptional,
|
||||
IsString,
|
||||
ValidateNested,
|
||||
isMongoId,
|
||||
} from "class-validator";
|
||||
import { IsArray, IsEnum, IsNotEmpty, IsOptional, IsString, ValidateNested } from "class-validator";
|
||||
import { Type } from "class-transformer";
|
||||
import { ISkillView } from "../../features/behavior_tree_builder/presentation/ui/skill_tree/skill_tree";
|
||||
import { v4 } from "uuid";
|
||||
import { Result } from "../helper/result";
|
||||
import { ValidationModel } from "./validation_model";
|
||||
import { ITopicModel, TopicViewModel } from "../../features/topics/topic_view_model";
|
||||
import { BehaviorTreeBuilderStore } from "../../features/behavior_tree_builder/presentation/behavior_tree_builder_store";
|
||||
import makeAutoObservable from "mobx-store-inheritance";
|
||||
import clone from "just-clone";
|
||||
import { BehaviorTreeBuilderStore } from "../../features/behavior_tree_builder/presentation/behavior_tree_builder_store";
|
||||
|
||||
export interface IDependency {
|
||||
skills: ISkillDependency[];
|
||||
}
|
||||
|
@ -68,7 +58,6 @@ export class ParamViewModel implements IParam {
|
|||
}
|
||||
export interface IBTAction {
|
||||
name: string;
|
||||
format: string;
|
||||
type: string;
|
||||
param: IParam[];
|
||||
result: string[];
|
||||
|
@ -123,6 +112,7 @@ export interface ILaunch {
|
|||
|
||||
export interface IModule {
|
||||
name: string;
|
||||
node_name: string;
|
||||
description: string;
|
||||
}
|
||||
|
||||
|
@ -159,6 +149,8 @@ export class SkillPackage implements ISkillPackage {
|
|||
static empty = () => new SkillPackage("", "", "");
|
||||
}
|
||||
export class Module implements IModule {
|
||||
@IsString()
|
||||
node_name: string;
|
||||
@IsString()
|
||||
name: string;
|
||||
@IsString()
|
||||
|
@ -172,8 +164,8 @@ export class Module implements IModule {
|
|||
export class BTAction implements IBTAction {
|
||||
@IsString()
|
||||
name: string;
|
||||
@IsString()
|
||||
format: string;
|
||||
// @IsString()
|
||||
// format: string;
|
||||
@IsString()
|
||||
type: string;
|
||||
sid?: string;
|
||||
|
@ -377,9 +369,8 @@ export class Skills {
|
|||
getSkillDo = (name: string) =>
|
||||
this.skills.reduce((acc, el) => {
|
||||
if (el.BTAction.find((el) => el.name.isEqual(name))) {
|
||||
|
||||
acc = el.Module.name;
|
||||
}
|
||||
}
|
||||
return acc;
|
||||
}, "error");
|
||||
|
||||
|
@ -486,3 +477,4 @@ export class Skills {
|
|||
() => Result.error(false)
|
||||
);
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue