Exemplo n.º 1
0
 private void PlayField_BlockGroupSet(object sender, TetrisField.BlockGroupSetEventArgs e)
 {
     if (OwnerState.PlayField.GetActiveBlockGroups().Count == 0)
     {
         pStateOwner.CurrentState = OwnerState;
     }
 }
        private void PlayField_BlockGroupSet(object sender, TetrisField.BlockGroupSetEventArgs e)
        {
            if (e._groups.All((n) => n.Y < 1))
            {
                GameOvered = true;
            }
            //reapply the theme when setting it down. Some themes may want
            //to have different appearances for blocks that are "set" versus those that are still "active".

            //TODO: for Dr Mario theme, the block set is using the "original" rotation when setting.
            //I suspect setting it to the field must be resetting the rotation of the blocks,

            foreach (var group in e._groups)
            {
                var    firstBlock = group.FirstOrDefault();
                Nomino useGroup   = group;
                if (firstBlock != null)
                {
                    useGroup = firstBlock.Block.Owner ?? group;
                }

                PlayField.Theme.ApplyTheme(useGroup, GameHandler, PlayField, NominoTheme.ThemeApplicationReason.FieldSet);
            }
        }
 public void InvokeBlockGroupSet(object sender, TetrisField.BlockGroupSetEventArgs e)
 {
     PlayField_BlockGroupSet(sender, e);
 }