Roles.cs

(完整代码) 1KB

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Tank_11_14
{
    public abstract class Roles : Member
    {
        //构造函数
        public Roles(int x, int y, int life, int width, int height, int speed, direction dr)//在构造基类
            : base(x, y, life, width, height, speed, dr)
        {

        }
        private int bornTimer = 0;
        public int BornTimer
        {
            get { return bornTimer; }
            set { bornTimer = value; }
        }
        private bool enable = true;

        public bool Enable
        {
            get { return enable; }
            set { enable = value; }
        }
        private bool isfire=true;

        public bool Isfire
        {
            get { return isfire; }
            set { isfire = value; }
        }

        //重写基类移动的方法
        public override void Move()
        {
            base.Adjustdirection();
            if (this.X > 600)         //判断与边缘是否相撞
                this.X = 600;
            if (this.X < 0)
                this.X = 0;
            if (this.Y > 600)
                this.Y = 600;
            if (this.Y < 0)
                this.Y = 0;
        }
        //构造一个开火的抽象方法
        public abstract void Fire();
        //创建出生的方法
        public abstract void Beborn();
    }
}

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

AI 解读 AI

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

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