|
|
@ -8,15 +8,16 @@ public class Term |
|
|
|
{ |
|
|
|
{ |
|
|
|
public Identifier ID { get; set; } |
|
|
|
public Identifier ID { get; set; } |
|
|
|
public TermID? Source { get; set; } |
|
|
|
public TermID? Source { get; set; } |
|
|
|
public TermID? First { get; set; } |
|
|
|
public TermID? Relation { get; set; } |
|
|
|
public TermID? Second { get; set; } |
|
|
|
public TermID? Target { get; set; } |
|
|
|
public TermInOutKind InOut { get; set; } |
|
|
|
public TermInOutKind InOut { get; set; } |
|
|
|
public TermOperKind Oper { get; set; } |
|
|
|
public TermOperKind Oper { get; set; } |
|
|
|
public IdentifierFlags Flags { get; set; } |
|
|
|
public IdentifierFlags Flags { get; set; } |
|
|
|
|
|
|
|
|
|
|
|
public Term() { } |
|
|
|
public Term() { } |
|
|
|
public Term(Identifier id) => ID = id; |
|
|
|
public Term(Identifier id) => ID = id; |
|
|
|
public Term(TermID first, TermID second) { First = first; Second = second; } |
|
|
|
public Term(TermID relation, TermID target) |
|
|
|
|
|
|
|
{ Relation = relation; Target = target; } |
|
|
|
|
|
|
|
|
|
|
|
public static implicit operator Term(EntityRef entity) => new(entity); |
|
|
|
public static implicit operator Term(EntityRef entity) => new(entity); |
|
|
|
public static implicit operator Term(Entity entity) => new(entity); |
|
|
|
public static implicit operator Term(Entity entity) => new(entity); |
|
|
@ -34,8 +35,8 @@ public class Term |
|
|
|
public ecs_term_t ToFlecs(IAllocator allocator) => new() { |
|
|
|
public ecs_term_t ToFlecs(IAllocator allocator) => new() { |
|
|
|
id = ID, |
|
|
|
id = ID, |
|
|
|
src = Source?.ToFlecs(allocator) ?? default, |
|
|
|
src = Source?.ToFlecs(allocator) ?? default, |
|
|
|
first = First?.ToFlecs(allocator) ?? default, |
|
|
|
first = Relation?.ToFlecs(allocator) ?? default, |
|
|
|
second = Second?.ToFlecs(allocator) ?? default, |
|
|
|
second = Target?.ToFlecs(allocator) ?? default, |
|
|
|
inout = (ecs_inout_kind_t)InOut, |
|
|
|
inout = (ecs_inout_kind_t)InOut, |
|
|
|
oper = (ecs_oper_kind_t)Oper, |
|
|
|
oper = (ecs_oper_kind_t)Oper, |
|
|
|
id_flags = (ecs_id_t)(ulong)Flags, |
|
|
|
id_flags = (ecs_id_t)(ulong)Flags, |
|
|
|