/** Builds a FGameplayTagQueryExpression from this query. */ public void GetQueryExpr(CGameplayTagQueryExpression OutExpr) { //根据传入的steam token创建表达式树 FQueryEvaluator QE = new FQueryEvaluator(this); QE.Read(OutExpr); }
/** 创建一个query */ public static FGameplayTagQuery BuildQuery(CGameplayTagQueryExpression RootQueryExpr, string InDescription = "") { FGameplayTagQuery Q = new FGameplayTagQuery(); Q.Build(RootQueryExpr, InDescription); return(Q); }
/** 创建查询byte数据, 根据传入的查询表达式. */ public void Build(CGameplayTagQueryExpression RootQueryExpr, string InUserDescription) { UserDescription = InUserDescription; QueryTokenStream.Clear(); TagDictionary.Clear(); // emit the query QueryTokenStream.Add(1); // true to indicate is has a root expression RootQueryExpr.EmitTokens(QueryTokenStream, TagDictionary); }
private void ReadExpr(CGameplayTagQueryExpression E) { E.ExprType = (CGameplayTagQueryExprType)GetToken(); if (bReadError) { return; } if (E.UsesTagSet()) { // parse tag set byte NumTags = GetToken(); if (bReadError) { return; } for (byte Idx = 0; Idx < NumTags; ++Idx) { byte TagIdx = GetToken(); if (bReadError) { return; } CGameplayTag Tag = Query.GetTagFromIndex(TagIdx); E.AddTag(Tag); } } else { // parse expr set byte NumExprs = GetToken(); if (bReadError) { return; } for (byte Idx = 0; Idx < NumExprs; ++Idx) { CGameplayTagQueryExpression Exp = new CGameplayTagQueryExpression(); ReadExpr(Exp); Exp.AddExpr(Exp); } } }
/** 解析 the token stream 数据 传入到 FGameplayTagQueryExpression. */ public void Read(CGameplayTagQueryExpression E) { CurStreamIdx = 0; if (Query.IsEmpty()) { return; } // start parsing the set if (!bReadError) { bool bHasRootExpression = GetToken() != 0; if (!bReadError && bHasRootExpression) { ReadExpr(E); } } }
public CGameplayTagQueryExpression AddExpr(CGameplayTagQueryExpression Expr) { ExprSet.Add(Expr); return(this); }
/** * 创建 有完全没有tag匹配的查询 */ public static FGameplayTagQuery MakeQuery_MatchNoTags(CGameplayTagContainer InTags) { var qe = new CGameplayTagQueryExpression(); return(BuildQuery(qe.NoTagsMatch().AddTags(InTags))); }