public Block CreateBlock(int index, string subject) { switch (_startTime.BlockType) { case "RegularBlock": return(new RegularBlock(_startTime.For(index), subject)); case "DoubleBlock": return(new DoubleBlock(_startTime.For(index), subject)); default: throw new NotSupportedException($"Unsupported block type '{_startTime.BlockType}'!"); } }
public TimeSpan For(int index) { var breakStart = _breakStart.For(index); var nextBlock = _blockStartTime.For(index + 1); return(nextBlock.Subtract(breakStart)); }
public TimeSpan For(int index) { var block = _blockStartTime.For(index); return(block.Add(_blockDuration)); }