movie.cs

来自「青鸟影院」· CS 代码 · 共 79 行

CS
79
字号
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.Serialization.Formatters.Binary;

namespace GreenBirdCinema
{
    /// <summary>
    /// 电影类
    /// </summary>
    /// 
    [Serializable]
    public class Movie
    {
        //添加两个有参的和无参的构造函数
        public Movie() 
        {
            movieType = new MovieType();
        }
        public Movie(string movieName,string poster,string director,string actor,MovieType movieType,int price)
        {
            this.MovieName = movieName;
            this.Poster = poster;
            this.Director = director;
            this.Actor = actor;
            this.MovieType = movieType;
            this.Price = price;
        }

        private string movieName;        //电影名

        public string MovieName
        {
            get { return movieName; }
            set { movieName = value; }
        }

        private string poster;          //海报图片名

        public string Poster
        {
            get { return poster; }
            set { poster = value; }
        }

        private string director;        //导演名

        public string Director
        {
            get { return director; }
            set { director = value; }
        }

        private string actor;           //主演

        public string Actor
        {
            get { return actor; }
            set { actor = value; }
        }

        private MovieType movieType;    //电影类型

        public MovieType MovieType
        {
            get { return movieType; }
            set { movieType = value; }
        }

        private int price;              //定价

        public int Price
        {
            get { return price; }
            set { price = value; }
        }
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?