Beispiel #1
0
        public void Move(bool ToRight)
        {
            lock (SyncAtkDefMove) {
                if (ToRight)
                {
                    Position++;
                }
                else
                {
                    Position--;
                }

                Write.StayNormal(ref _Position, Side);
            }
        }
Beispiel #2
0
        public Player(int initialPosition, PlayerSide Side)
        {
            Write = Writter.GetInstance();

            HealthPoints   = 9;
            Position       = initialPosition;
            AtkAvailable   = 3;
            DefAvailable   = 2;
            DefendingState = false;
            this.Side      = Side;

            AttackThread  = new Thread(GenerateAtk);
            DefenseThread = new Thread(GenerateDef);

            AttackThread.Name  = "GenarateAtk";
            DefenseThread.Name = "GenerateDef";

            AttackThread.Start();
            DefenseThread.Start();

            Write.StayNormal(ref _Position, Side);
        }