Member.cs

(开头部分) 2KB

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

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
// 下载于www.51aspx.com
namespace Tank_11_14
{
    //继承Element(坦克)
    public abstract class Member:Element
    {
        public direction dr;//方向
        private int life;//生命值

        public int Life
        {
            get { return life; }
            set { life = value; }
        }
        private int speed;//速度

        public int Speed
        {
            get { return speed; }
            set { speed = value; }
        }
        private int width;//宽度

        public int Width
        {
            get { return width; }
            set { width = value; }
        }
        private int hight;//高度

        public int Hight
        {
            get { return hight; }
            set { hight = value; }
        }
        public Member(int x,int y,int life, int width, int hight, int speed, direction dr):base(x,y)
        {
            this.dr = dr;   //定义方向字段
            this.life = life;         //定义生命力字段
            this.width = width;        //定义宽度字段
            this.hight = hight;       //定义高度字段
            this.speed = speed;        //定义速度字段
        }
        public abstract void Move();
        //检测是否碰撞
        public Rectangle GetRectangle()
        {
            //返回成员矩形
            //返回的应该是属性的值
            return new Rectangle(this.X, this.Y, Width, Hight );
        }
        //返回的值并向不同方向移动
        //根据传进来的不同方向参数,判断移动的方法
        public virtual void Adjustdirection()
        {
后面还有 18 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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