mirror of
https://github.com/DCFApixels/DragonECS-Graphs.git
synced 2025-09-17 19:24:36 +08:00
update
This commit is contained in:
parent
8dce296a25
commit
7792ce5990
@ -120,12 +120,12 @@ namespace DragonECS.DragonECS
|
|||||||
|
|
||||||
#region Has
|
#region Has
|
||||||
public bool HasRelation(int entityID, int otherEntityID) => _source._relationsMatrix.Contains(entityID, otherEntityID);
|
public bool HasRelation(int entityID, int otherEntityID) => _source._relationsMatrix.Contains(entityID, otherEntityID);
|
||||||
public bool HasRelationWith(EcsSubject subject, int entityID, int otherEntityID)
|
//public bool HasRelationWith(EcsSubject subject, int entityID, int otherEntityID)
|
||||||
{
|
//{
|
||||||
if (subject.World != _relationWorld)
|
// if (subject.World != _relationWorld)
|
||||||
throw new ArgumentException();
|
// throw new ArgumentException();
|
||||||
return _source._relationsMatrix.TryGetValue(entityID, otherEntityID, out int entity) && subject.IsMatches(entity);
|
// return _source._relationsMatrix.TryGetValue(entityID, otherEntityID, out int entity) && subject.IsMatches(entity);
|
||||||
}
|
//}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region GetRelation
|
#region GetRelation
|
||||||
@ -139,27 +139,32 @@ namespace DragonECS.DragonECS
|
|||||||
{
|
{
|
||||||
return _source._relationsMatrix.TryGetValue(entityID, otherEntityID, out entity);
|
return _source._relationsMatrix.TryGetValue(entityID, otherEntityID, out entity);
|
||||||
}
|
}
|
||||||
public bool TryGetRelation(EcsSubject subject, int entityID, int otherEntityID, out int entity)
|
//public bool TryGetRelation(EcsSubject subject, int entityID, int otherEntityID, out int entity)
|
||||||
{
|
//{
|
||||||
return _source._relationsMatrix.TryGetValue(entityID, otherEntityID, out entity) && subject.IsMatches(entity);
|
// return _source._relationsMatrix.TryGetValue(entityID, otherEntityID, out entity) && subject.IsMatches(entity);
|
||||||
}
|
//}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region GetRelations
|
#region GetRelations
|
||||||
//ReadOnlySpan<int> временная заглушка, потому тут будет спан из линкедлиста
|
public IdsLinkedList.Span GetRelations(int entityID)
|
||||||
public ReadOnlySpan<int> GetRelations(int entityID)
|
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
return _basket.GetSpanFor(entityID);
|
||||||
}
|
}
|
||||||
//ReadOnlySpan<int> временная заглушка, потому тут будет спан из линкедлиста
|
//ReadOnlySpan<int> временная заглушка, потому тут будет спан из линкедлиста
|
||||||
public ReadOnlySpan<int> GetRelationsWith(EcsSubject subject, int entityID)
|
//public ReadOnlySpan<int> GetRelationsWith(EcsSubject subject, int entityID)
|
||||||
{
|
//{
|
||||||
if (subject.World != _relationWorld)
|
// if (subject.World != _relationWorld)
|
||||||
throw new ArgumentException();
|
// throw new ArgumentException();
|
||||||
throw new NotImplementedException();
|
// throw new NotImplementedException();
|
||||||
}
|
//}
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public struct RelationsSpan
|
||||||
|
{
|
||||||
|
private readonly IdsBasket _basket;
|
||||||
|
private readonly EcsSubject _subject;
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user