Пример #1
0
        }                                 // 玩家体重

        // 扫码二维码
        public bool ScanQRCode(FitnessApparatus apparatus)
        {
            if (apparatus.StatusContext.DisplayStatus is DisplayQRCode qrCode)
            {
                return(qrCode.Scavenging(apparatus.StatusContext));
            }
            return(false);
        }
Пример #2
0
        private readonly Player Player;                     // 玩家对象

        public Form1()
        {
            InitializeComponent();
            FitnessApparatus = new FitnessApparatus();
            this.Player      = new Player()
            {
                Weight = 52
            };
        }
Пример #3
0
 // 站到健身仪器上
 public bool StandUp(FitnessApparatus apparatus)
 {
     if (standUpApparatus == apparatus)
     {
         return(false);
     }
     apparatus.StatusContext.PressureStatus = new UnderPressure(this.Weight);
     standUpApparatus = apparatus;
     return(true);
 }
Пример #4
0
        // 从健身仪器上下来
        public FitnessApparatus ComeDown()
        {
            var apparatus = standUpApparatus;

            if (apparatus == null)
            {
                return(null);
            }
            apparatus.StatusContext.PressureStatus = new NoPressure();
            standUpApparatus = null;
            return(apparatus);
        }