public Block CreateSeparator() { if (SeparatorFactory == null) { return(null); } return(SeparatorFactory.CreateBlock()); }
void MigrateNextBlockToContainer() { if (!m_block_container.AddBlock(m_block_next)) { IsGameOver = true; } m_block_next = m_random_factory.CreateBlock(); }
public string CreateDirectory(string name, string localizationId) { try { var fileHeader = headerFactory.CreateDirectory(name); TOC tocForHeader = GetTOCForHeader(fileHeader, localizationId); fileHeader.BlockNumber = BlockNumber; WriteNewTOC(); tocForHeader.AddFileHeader(fileHeader); Position = (tocForHeader.BlockNumber * Settings.BlockSize); Write(blockFactory.CreateBlock(tocForHeader), 0, Settings.BlockSize); } catch (Exception ex) { return(ex.Message); } return("The directory was created successfully"); }
public async void Post([FromBody] string value) { SimpleBlock lastBlock = _blockChain.LatestBlock; SimpleBlock newBlock = _blockFactory.CreateBlock(lastBlock, value); _blockChain.Add(newBlock); await _p2PService.Broadcast(_p2PService.ResponseLatestMessage()); string s = JsonConvert.SerializeObject(newBlock); _logger.LogInformation("Block added: " + s); }
public XBlock Deserialize(ISheet sheet, XBlock parent, ItemBlock blockItem, double thickness) { var block = _blockFactory.CreateBlock(blockItem.Id, blockItem.X, blockItem.Y, blockItem.Width, blockItem.Height, blockItem.DataId, blockItem.Name, blockItem.Backgroud); foreach (var textItem in blockItem.Texts) { Deserialize(sheet, block, textItem); } foreach (var imageItem in blockItem.Images) { Deserialize(sheet, block, imageItem); } foreach (var lineItem in blockItem.Lines) { Deserialize(sheet, block, lineItem, thickness); } foreach (var rectangleItem in blockItem.Rectangles) { Deserialize(sheet, block, rectangleItem, thickness); } foreach (var ellipseItem in blockItem.Ellipses) { Deserialize(sheet, block, ellipseItem, thickness); } foreach (var childBlockItem in blockItem.Blocks) { Deserialize(sheet, block, childBlockItem, thickness); } foreach (var pointItem in blockItem.Points) { Deserialize(sheet, block, pointItem, thickness); } parent.Blocks.Add(block); return(block); }
private void Initialize() { for (int x = 0; x < Size; x++) { for (int y = 0; y < Size; y++) { for (int z = 0; z < Size; z++) { int blockIndex = GetBlockIndex(x, y, z); IBlock block = _blockFactory.CreateBlock(BlockType.Air, x, y, z, Chunk); _blocks[blockIndex] = block; _blockStorage[blockIndex] = _palette.SetState(block.State.Id); } } } }