예제 #1
0
파일: PropertySink.cs 프로젝트: toeb/Blocks
 public PropertySink(Block block, PropertyInfo info)
     : base(block)
 {
     Contract.Assume(info.CanWrite == true);
       _info = info;
       _inputAttribute = info.GetCustomAttributes(typeof(SinkAttribute), true).FirstOrDefault() as SinkAttribute;
 }
예제 #2
0
파일: Grid.cs 프로젝트: remy22/DeltaEngine
 public List<int> GetValidStartingColumns(Block block)
 {
     block.Top = 1;
     List<int> validStartingColumns = content.DoBlocksStartInARandomColumn
         ? GetAllValidStartingColumns(block) : GetMiddleColumnIfValid(block);
     return validStartingColumns;
 }
예제 #3
0
		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);
		}
예제 #4
0
파일: Grid.cs 프로젝트: whztt07/DeltaEngine
		public int AffixBlock(Block block)
		{
			foreach (Brick brick in block.Bricks.Where(brick => !IsOccupied(brick)))
				AffixBrick(brick);
			RemoveFilledRows();
			return removedRows;
		}
예제 #5
0
 public void Init()
 {
     block = new Block();
     block.GetClears().Add("B3");
     block.GetClears().Add("B6");
     block.GetOntables().Add("B3");
     block.GetOntables().Add("B6");
 }
예제 #6
0
        public int AffixBlock(Block block)
        {
            foreach (Brick brick in block.Bricks)
                AffixBrick(brick);

            RemoveFilledRows();
            return removedRows;
        }
예제 #7
0
		private void GetRidOfGameObjects()
		{
			Get<Grid>().Clear();
			totalRowsRemoved = 0;
			UpcomingBlock.IsActive = false;
			UpcomingBlock = null;
			FallingBlock.IsActive = false;
			FallingBlock = null;
		}
예제 #8
0
 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();
    }
예제 #10
0
        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;
        }
예제 #11
0
파일: Sink.cs 프로젝트: toeb/Blocks
 protected override void SetBlock(Block block)
 {
     AddSuccessor(block);
 }
예제 #12
0
파일: Grid.cs 프로젝트: whztt07/DeltaEngine
		private List<int> GetMiddleColumnIfValid(Block block)
		{
			var validStartingColumns = new List<int>();
			if (IsAValidStartingColumn(block, Middle))
				validStartingColumns.Add(Middle - (int)block.Center.X);

			return validStartingColumns;
		}
예제 #13
0
파일: Grid.cs 프로젝트: whztt07/DeltaEngine
		} //ncrunch: no coverage end

		private bool IsAValidStartingColumn(Block block, int column)
		{
			block.Left = column;
			return IsValidPosition(block);
		}
예제 #14
0
파일: Grid.cs 프로젝트: whztt07/DeltaEngine
		//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
예제 #15
0
파일: Grid.cs 프로젝트: whztt07/DeltaEngine
		public bool IsValidPosition(Block block)
		{
			foreach (Brick brick in block.Bricks)
				if (IsOutsideTheGrid(brick) || IsOccupied(brick))
					return false;
			return true;
		}
예제 #16
0
파일: Source.cs 프로젝트: toeb/Blocks
 public Source(Block parent)
     : base(parent)
 {
 }
예제 #17
0
파일: Source.cs 프로젝트: toeb/Blocks
 protected override void SetBlock(Block block)
 {
     AddPredecessor(block);
 }
예제 #18
0
 public bool CanRender(Block block)
 {
     return true;
 }
예제 #19
0
파일: Connector.cs 프로젝트: toeb/Blocks
 protected abstract void SetBlock(Block block);
예제 #20
0
파일: Sink.cs 프로젝트: toeb/Blocks
 public Sink(Block block)
     : base(block)
 {
 }
예제 #21
0
 protected IBlockRenderer GetBlockRenderer(Block block)
 {
     return Options.Renderers.First(r => r.CanRender(block));
 }
예제 #22
0
파일: Connector.cs 프로젝트: toeb/Blocks
 public Connector(Block block)
 {
     Contract.Assume(block != null);
       Block = block;
 }
예제 #23
0
 public HtmlTag Render(Document document, Block block)
 {
     return HtmlTag.Empty();
 }