コード例 #1
0
        public void TestInequality()
        {
            var a1 = new ComponentAccessor(typeof(ISimpleComponent));
            var a2 = new ComponentAccessor(typeof(IOtherSimpleComponent));

            (a1 != a2).ShouldBeTrue();
        }
        public void TestInequality()
        {
            var a1 = new ComponentAccessor(typeof(ISimpleComponent));
            var a2 = new ComponentAccessor(typeof(IOtherSimpleComponent));

            (a1 != a2).ShouldBeTrue();
        }
コード例 #3
0
ファイル: EntityDirtyTracker.cs プロジェクト: Simie/OpenAOE
        /// <summary>
        /// Set the component with <paramref name="accessor"/> to be dirty.
        /// </summary>
        /// <param name="accessor">Component accessor to mark as dirty.</param>
        /// <returns>True if successfully marked component as dirty. False if component is already dirty.</returns>
        public bool TrySetDirty(ComponentAccessor accessor)
        {
            var id = accessor.Id;

            if (_dirtyComponents.TryAdd(id, true))
                return true;

            if (!_dirtyComponents.TryUpdate(id, true, false))
            {
                return false;
            }

            return true;
        }
 public EntityComponentModified(uint entityId, ComponentAccessor componentAccessor)
 {
     EntityId          = entityId;
     ComponentAccessor = componentAccessor;
 }
コード例 #5
0
 public static Type GetType(ComponentAccessor accessor)
 {
     return _ids.Single(p => p.Value == accessor.Id).Key;
 }
コード例 #6
0
ファイル: EntityDirtyTracker.cs プロジェクト: Simie/OpenAOE
 /// <summary>
 /// Reset component with <paramref name="accessor"/> to be not-dirty.
 /// </summary>
 /// <param name="accessor">Component accessor to mark as not-dirty.</param>
 public void Reset(ComponentAccessor accessor)
 {
     _dirtyComponents.AddOrUpdate(accessor.Id, false, (i, b) => false);
 }
コード例 #7
0
 public EntityComponentModified(uint entityId, ComponentAccessor componentAccessor)
 {
     EntityId = entityId;
     ComponentAccessor = componentAccessor;
 }