public PropertySink(Block block, PropertyInfo info) : base(block) { Contract.Assume(info.CanWrite == true); _info = info; _inputAttribute = info.GetCustomAttributes(typeof(SinkAttribute), true).FirstOrDefault() as SinkAttribute; }
public List<int> GetValidStartingColumns(Block block) { block.Top = 1; List<int> validStartingColumns = content.DoBlocksStartInARandomColumn ? GetAllValidStartingColumns(block) : GetMiddleColumnIfValid(block); return validStartingColumns; }
private void CreateUpcomingBlock() { UpcomingBlock = new Block(displayMode, content, Vector2D.Zero); UpcomingBlock.Left = upcomingBlockCenter.X - UpcomingBlock.Center.X; UpcomingBlock.Top = upcomingBlockCenter.Y - UpcomingBlock.Center.Y; UpcomingBlock.UpdateBrickDrawAreas(0.0f); }
public int AffixBlock(Block block) { foreach (Brick brick in block.Bricks.Where(brick => !IsOccupied(brick))) AffixBrick(brick); RemoveFilledRows(); return removedRows; }
public void Init() { block = new Block(); block.GetClears().Add("B3"); block.GetClears().Add("B6"); block.GetOntables().Add("B3"); block.GetOntables().Add("B6"); }
public int AffixBlock(Block block) { foreach (Brick brick in block.Bricks) AffixBrick(brick); RemoveFilledRows(); return removedRows; }
private void GetRidOfGameObjects() { Get<Grid>().Clear(); totalRowsRemoved = 0; UpcomingBlock.IsActive = false; UpcomingBlock = null; FallingBlock.IsActive = false; FallingBlock = null; }
public void Init2() { block = new Block(); block.GetClears().Add("B1"); block.GetClears().Add("B6"); block.GetOns().Add(new ON("B1", "B3")); block.GetOntables().Add("B3"); block.GetOntables().Add("B6"); }
/// <summary> /// Destroy the block at the given block location /// </summary> /// <param name="hitLocation"></param> public void destroyBlock(Coordinate blockLocation) { Blocks.Block blockToDestroy = chunk.getBlock(blockLocation.trimmed); // replace with air in the model chunk.destroyBlock(blockToDestroy); // update the chunk mesh and re-render. renderChunk(); }
public PropertySource(Block block, PropertyInfo info) : base(block) { Contract.Assume(info.CanRead == true); _outputAttribute = info.GetCustomAttributes(typeof(SourceAttribute), true).FirstOrDefault() as SourceAttribute; _info = info; IsDataReady = true; var inpc = block.Content as INotifyPropertyChanged; if (inpc == null) return; inpc.PropertyChanged += UnderlyingPropertyChanged; IsDataReady = true; }
protected override void SetBlock(Block block) { AddSuccessor(block); }
private List<int> GetMiddleColumnIfValid(Block block) { var validStartingColumns = new List<int>(); if (IsAValidStartingColumn(block, Middle)) validStartingColumns.Add(Middle - (int)block.Center.X); return validStartingColumns; }
} //ncrunch: no coverage end private bool IsAValidStartingColumn(Block block, int column) { block.Left = column; return IsValidPosition(block); }
//ncrunch: no coverage start private List<int> GetAllValidStartingColumns(Block block) { var validStartingColumns = new List<int>(); for (int x = 0; x < Width; x++) if (IsAValidStartingColumn(block, x)) validStartingColumns.Add(x); return validStartingColumns; } //ncrunch: no coverage end
public bool IsValidPosition(Block block) { foreach (Brick brick in block.Bricks) if (IsOutsideTheGrid(brick) || IsOccupied(brick)) return false; return true; }
public Source(Block parent) : base(parent) { }
protected override void SetBlock(Block block) { AddPredecessor(block); }
public bool CanRender(Block block) { return true; }
protected abstract void SetBlock(Block block);
public Sink(Block block) : base(block) { }
protected IBlockRenderer GetBlockRenderer(Block block) { return Options.Renderers.First(r => r.CanRender(block)); }
public Connector(Block block) { Contract.Assume(block != null); Block = block; }
public HtmlTag Render(Document document, Block block) { return HtmlTag.Empty(); }