Esempio n. 1
0
        private void GameEnd_NewGamed(object sender, EventArgs e)
        {
            GameStarted                  = false;
            GameFinished                 = false;
            GameEnd.Visibility           = Visibility.Collapsed;
            WhiteOffer.Visibility        = Visibility.Collapsed;
            BlackOffer.Visibility        = Visibility.Collapsed;
            WhiteConfirmation.Visibility = Visibility.Collapsed;
            BlackConfirmation.Visibility = Visibility.Collapsed;
            Game = new GameHandler();

            MoveHistoryGrid.Children.Clear();
            MoveHistoryGrid.ColumnDefinitions.Clear();
            MoveHistoryGrid.RowDefinitions.Clear();

            LastMove = ((-1, -1), (-1, -1));
            MoveButtons.Clear();
            LastSound.Clear();
            LastSound.Add("White", new List <string>());
            LastSound.Add("Black", new List <string>());

            whiteTimer = null;
            blackTimer = null;

            WhiteTimeTextBlock.Text = "";
            BlackTimeTextBlock.Text = "";

            RenderModels(Game.Board);
            RenderCapturedPieces();
        }
Esempio n. 2
0
    void Awake()
    {
        if (Instance == null)
        {
            Instance = this;
        }

        //	DontDestroyOnLoad(gameObject);
    }
 private void SetMoveInput(InputMoverComponent component, MoveButtons buttons)
 {
     if (component.HeldMoveButtons == buttons)
     {
         return;
     }
     component.HeldMoveButtons = buttons;
     Dirty(component);
 }
Esempio n. 4
0
 void Start()
 {
     instance = this;
 }
Esempio n. 5
0
 public MoverComponentState(MoveButtons buttons, bool canMove)
 {
     Buttons = buttons;
     CanMove = canMove;
 }
Esempio n. 6
0
 public MoverComponentState(MoveButtons buttons)
 {
     Buttons = buttons;
 }
        private void SetMoveInput(InputMoverComponent component, ushort subTick, bool enabled, MoveButtons bit)
        {
            // Modifies held state of a movement button at a certain sub tick and updates current tick movement vectors.
            ResetSubtick(component);

            if (subTick >= component.LastInputSubTick)
            {
                var fraction = (subTick - component.LastInputSubTick) / (float)ushort.MaxValue;

                ref var lastMoveAmount = ref component.Sprinting ? ref component.CurTickSprintMovement : ref component.CurTickWalkMovement;

                lastMoveAmount += DirVecForButtons(component.HeldMoveButtons) * fraction;

                component.LastInputSubTick = subTick;
            }