public void PushBack() { var world = Helpers.PrepareWorld(); var data = new Data("data6"); var list = new ME.ECS.Collections.IntrusiveStackGeneric <Data>(); list.Push(new Data("data1")); list.Push(new Data("data2")); list.Push(new Data("data3")); list.Push(new Data("data4")); list.Push(data); list.PushBack(new Data("data5")); UnityEngine.Debug.Assert(list.Count == 6); UnityEngine.Debug.Assert(list.Peek().a == data.a); Helpers.CompleteWorld(world); }
public void Peek() { var world = Helpers.PrepareWorld(); var first = new Data("data1"); var e = new Data("data3"); var last = new Data("data5"); var list = new ME.ECS.Collections.IntrusiveStackGeneric <Data>(); list.Push(first); list.Push(new Data("data2")); list.Push(e); list.Push(new Data("data4")); list.Push(last); UnityEngine.Debug.Assert(list.Peek().a == last.a); Helpers.CompleteWorld(world); }