Esempio n. 1
0
            protected virtual void SetBlock(SuperBlock block, TBlockSubtypes subtypeId, bool addSubtype = true)
            {
                this.block     = block;
                this.SubtypeId = subtypeId;

                if (addSubtype)
                {
                    block.SubtypeId |= subtypeId;
                    block.subtypeAccessors.Add(this);
                }
            }
Esempio n. 2
0
        public static TBlockSubtypes GetLargestSubtype(this TBlockSubtypes subtypeId)
        {
            for (int n = subtypes.Count - 1; n >= 0; n--)
            {
                if ((subtypeId & subtypes[n]) == subtypes[n])
                {
                    return(subtypes[n]);
                }
            }

            return(TBlockSubtypes.None);
        }
Esempio n. 3
0
            protected override void SetBlock(SuperBlock block, TBlockSubtypes subtypeId, bool addSubtype = true)
            {
                this.block     = block;
                subtype        = block.TBlock as T;
                this.SubtypeId = subtypeId;

                if (addSubtype && subtype != null)
                {
                    block.SubtypeId |= subtypeId;
                    block.subtypeAccessors.Add(this);
                }
            }
Esempio n. 4
0
        public virtual void Reset()
        {
            for (int i = 0; i < subtypeAccessors.Count; i++)
            {
                subtypeAccessors[i].Reset();
            }

            if (TBlock != null)
            {
                TBlock.OnMarkForClose -= BlockClosing;
            }

            subtypeAccessors.Clear();
            TypeID       = null;
            TBlock       = null;
            TerminalGrid = null;
            SubtypeId    = 0;
        }
Esempio n. 5
0
 public static bool UsesSubtype(this TBlockSubtypes subtypeId, TBlockSubtypes flag) =>
 (subtypeId & flag) == flag;
Esempio n. 6
0
 protected virtual void SetBlock(SuperBlock block, TBlockSubtypes subtypeId, TBlockSubtypes prerequsites) =>
 SetBlock(block, subtypeId, block.SubtypeId.UsesSubtype(prerequsites));
Esempio n. 7
0
 public virtual void Reset()
 {
     SubtypeId = TBlockSubtypes.None;
     block     = null;
 }