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

            _blockList.Remove(attribs);
        }
예제 #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);
 }
예제 #3
0
        public void RemoveAttribs(BlockAttribs attribs)
        {
            if (!_blockList.ContainsKey(attribs))
            {
                throw new InvalidOperationException("Attribs don't exist");
            }

            _blockList.Remove(attribs);
        }
예제 #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);
        }
예제 #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);
        }
예제 #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);
     }
 }
예제 #7
0
 public BlockAttribs SetPrevAttribs(BlockAttribs attribs)
 {
     _prevAttribs = attribs;
     return attribs;
 }
예제 #8
0
 public BlockAttribs SetPrevAttribs(BlockAttribs attribs)
 {
     _prevAttribs = attribs;
     return(attribs);
 }
예제 #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;
		}