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(); }
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); }
void Start() { instance = this; }
public MoverComponentState(MoveButtons buttons, bool canMove) { Buttons = buttons; CanMove = canMove; }
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; }