Block.cs

(开头部分) 3KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections;
using System.Drawing;
using System.Text;

namespace Tetris
{
    class Block
    {
        protected Point[] structArr; //存放方块组成信息的坐标数组
        protected int _xPos; // 方块中心点所在的x坐标
        protected int _yPos; // 方块中心点所在的y坐标
        protected Color _blockColor; //方块颜色
        protected Color disapperColor; //擦除颜色
        protected int rectPix; //每个单元格像素
        public Block()
        {
            //默认构造函数,声明此构造函数为了能够创建子类
        }
        public Block(Point[] sa, Color bColor, Color dColor, int pix)
        {
            //重载构造函数,给成员变量赋值
            _blockColor = bColor;
            disapperColor = dColor;
            rectPix = pix;
            structArr = sa;
        }
        public Point this[int index] //索引器,根据索引访问方块里的小方块坐标
        {
            get
            {
                return structArr[index];
            }
        }
        public int Length //属性,表示structArr的长度
        {
            get
            {
                return structArr.Length;
            }
        }
        public int XPos
        {
            get
            {
                return _xPos;
            }
            set
            {
                _xPos = value;
            }
        }
        public int YPos
        {
            get
            {
                return _yPos;
            }
            set
            {
后面还有 61 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。