public void Update() { mario.Sprite.Update(); ICommand reset = new CommandReset(mario.Mygame); reset.Execute(); }
public void Draw(SpriteBatch sb, Vector2 vector) { if (!ifDisappear) { if (timer <= 0 || dead) { Sprite.Draw(sb, new Vector2(Position.X - vector.X, Position.Y - vector.Y)); } else { if (flasher % Utility.MarioFlashSpeed == 0) { Sprite.Draw(sb, new Vector2(Position.X - vector.X, Position.Y - vector.Y)); } } } else { resetTimer++; if (resetTimer++ == Utility.timer_check_mario_class) { ICommand reset = new CommandReset(Mygame); reset.Execute(); } } }
public void Update() { timer--; mario.Sprite.Update(); Sound.Instance.StopTheme(); if (timer == 0) { ICommand reset = new CommandReset(mario.Mygame); reset.Execute(); } }
private void RegisterForMessages() { Messenger.Default.Register <NotificationMessage>(this, message => { if (message.Notification == Commands.AddItem) { if (CommandAdd.CanExecute(null)) { CommandAdd.Execute(null); } } else if (message.Notification == Commands.EditItem) { if (CommandEdit.CanExecute(null)) { CommandEdit.Execute(null); } } if (message.Notification == Commands.ResetItem) { if (CommandReset.CanExecute(null)) { CommandReset.Execute(null); } } else if (message.Notification == Commands.DeleteItem) { if (CommandDelete.CanExecute(null)) { CommandDelete.Execute(null); } } else if (message.Notification == Commands.ResetAll) { if (CommandResetAll.CanExecute(null)) { CommandResetAll.Execute(null); } } }); Messenger.Default.Register <NotificationMessage <ItemModel> >(this, message => { if (message.Notification == Notifications.NotifyItemSelected) { RaisePropertyChanged("IsItemSelected"); RaiseCanExecuteChanged(CommandEdit); RaiseCanExecuteChanged(CommandReset); RaiseCanExecuteChanged(CommandDelete); } }); }