Beispiel #1
0
        public void RemoveAttribs(BlockAttribs attribs)
        {
            if (!_blockList.ContainsKey(attribs))
                throw new InvalidOperationException("Attribs don't exist");

            _blockList.Remove(attribs);
        }
Beispiel #2
0
 public void Add(BlockAttribs attribs, RABlock block)
 {
     if (!_blockList.ContainsKey(attribs))
         _blockList.Add(attribs, new List<RABlock>() { block });
     else
         _blockList[attribs].Add(block);
 }
Beispiel #3
0
        public void RemoveAttribs(BlockAttribs attribs)
        {
            if (!_blockList.ContainsKey(attribs))
            {
                throw new InvalidOperationException("Attribs don't exist");
            }

            _blockList.Remove(attribs);
        }
Beispiel #4
0
        public void RemoveBlock(BlockAttribs attribs, RABlock block)
        {
            if (!_blockList.ContainsKey(attribs))
                throw new InvalidOperationException("Attribs don't exist");

            if (!_blockList[attribs].Contains(block))
                throw new InvalidOperationException("Block doesn't exist");

            _blockList[attribs].Remove(block);
        }
Beispiel #5
0
        public void RemoveBlock(BlockAttribs attribs, RABlock block)
        {
            if (!_blockList.ContainsKey(attribs))
            {
                throw new InvalidOperationException("Attribs don't exist");
            }

            if (!_blockList[attribs].Contains(block))
            {
                throw new InvalidOperationException("Block doesn't exist");
            }

            _blockList[attribs].Remove(block);
        }
Beispiel #6
0
 public void Add(BlockAttribs attribs, RABlock block)
 {
     if (!_blockList.ContainsKey(attribs))
     {
         _blockList.Add(attribs, new List <RABlock>()
         {
             block
         });
     }
     else
     {
         _blockList[attribs].Add(block);
     }
 }
Beispiel #7
0
 public BlockAttribs SetPrevAttribs(BlockAttribs attribs)
 {
     _prevAttribs = attribs;
     return attribs;
 }
Beispiel #8
0
 public BlockAttribs SetPrevAttribs(BlockAttribs attribs)
 {
     _prevAttribs = attribs;
     return(attribs);
 }
Beispiel #9
0
		/// <summary>
		/// Dequeues the current block attribute set and returns it, queuing a new attribute set.
		/// </summary>
		/// <returns></returns>
		public BlockAttribs NextAttribs(RABlock block)
		{
            BlockAttribs attribs = _newAttribs;

            _blockManager.Add(attribs, block);
            _blockManager.SetPrevAttribs(attribs);
            
            switch (attribs.Persistence)
            {
                case AttribPersistence.Off:
                    _newAttribs = new BlockAttribs();
                    break;

                case AttribPersistence.On:
                    _newAttribs = new BlockAttribs();
                    break;

                case AttribPersistence.Once:
                    _newAttribs = _blockManager.GetPrevious(1);
                    break;
            }

            return attribs;
		}