Rename remaining first/second to relation/target

wip/source-generators
copygirl 1 year ago
parent 1357906d64
commit 3ef86f5fa3
  1. 2
      src/gaemstone/ECS/Entity.cs
  2. 11
      src/gaemstone/ECS/Term.cs

@ -42,7 +42,7 @@ public readonly struct Entity
public static bool operator ==(Entity left, Entity right) => left.Equals(right);
public static bool operator !=(Entity left, Entity right) => !left.Equals(right);
public static Identifier operator &(Entity first, Entity second) => Identifier.Pair(first, second);
public static Identifier operator &(Entity relation, Entity target) => Identifier.Pair(relation, target);
public static implicit operator ecs_entity_t(Entity e) => e.Value;
public static implicit operator Identifier(Entity e) => new(e.Value.Data);

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

Loading…
Cancel
Save