Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IFilter

Combinations of components.

Attention: EntityAdmin.AddWatchings() use IFilter object's reference to identify.

// **************************************************************************************
// The codes below cannot get expected results.(f1 and f2 is not from the same reference)
// **************************************************************************************
// module_a.ts
const f1: IFilter = {
 all_of: [ComponentA, ComponentB],
  none_of: [ComponentC],
};
admin.AddWatchings(f1);

// module_b.ts
const f2: IFilter = {
 all_of: [ComponentA, ComponentB],
 none_of: [ComponentC],
};
for(const ent of admin.GetEnttsByFilter(f2)) { }

// **************************************
// You can do this in the following ways.
// **************************************
// module_c.ts
export const Match_1: IFilter = {
 all_of: all_of: [ComponentA, ComponentB],
 none_of: [ComponentC],
};

// module_a.ts
import { Match_1 } from "./module_c";
admin.AddWatchings(Match_1);

// module_b.ts
import { Match_1 } from "./module_c";
for(const ent of admin.GetEnttsByFilter(Match_1)) { }
export
interface

IFilter

Hierarchy

  • IFilter

Index

Properties

Properties

Optional all_of

all_of: [ComponentType, Array]

Optional any_of

any_of: [ComponentType, Array]

Optional none_of

none_of: [ComponentType, Array]