// Use this for initialization void Start() { _posemanager = GameObject.FindGameObjectWithTag("Posemanager").GetComponent <PoseManager>(); _PoseCanvas = GameObject.Find("Pose_canvas").GetComponent <Canvas>(); _OpenLeg = GameObject.Find("Pose_OpneLeg").GetComponent <Image>(); _openLeg = GameObject.Find("Pose_OpneLeg").GetComponent <Pose_opneLeg>(); _audioSource = GetComponent <AudioSource>(); _View = GameObject.Find("ScoreCanvas").GetComponent <Canvas>(); _view = _View.GetComponent <ScoreView>(); }
// Use this for initialization void Start() { _posemanager = GameObject.FindGameObjectWithTag("Posemanager").GetComponent <PoseManager>(); _PoseCanvas = GameObject.Find("Pose_canvas").GetComponent <Canvas>(); _AlphaX = GameObject.Find("Pose_X").GetComponent <Image>(); _alphaX = GameObject.Find("Pose_X").GetComponent <Pose_X>(); _audioSource = GetComponent <AudioSource>(); _View = GameObject.Find("ScoreCanvas").GetComponent <Canvas>(); _view = _View.GetComponent <ScoreView>(); }
private void Awake() { _pool = new ObjectsPool(); GridView gridView = Instantiate(_gridViewPrefab, _gameCanvas.transform); gridView.SetupDependencies(_pool); _gridController = new GridController(gridView, GridSettings.instance); ScoreView scoreView = Instantiate(_scoreViewPrefab, _gameCanvas.transform); _scoreController = new ScoreController(scoreView, _gridController); }
void ReleaseDesignerOutlets() { if (ScoreView != null) { ScoreView.Dispose(); ScoreView = null; } if (TitleLabel != null) { TitleLabel.Dispose(); TitleLabel = null; } }
// Use this for initialization void Start() { isRunning = false; menu = GameObject.Find("Canvas/StartMenu").GetComponent <MenuView>(); scorePanel = GameObject.Find("Canvas/ScorePanel").GetComponent <ScoreView>(); gameSummary = GameObject.Find("Canvas/GameSummary").GetComponent <GameSummaryView>(); bird = Camera.main.transform.Find("Bird").GetComponent <BirdController>(); obstacleManager = GameObject.Find("ObstacleManager").GetComponent <ObstacleManager>(); backgroundController = GameObject.Find("Background").GetComponent <BackgroundController>(); menu.Activate(); }
public async Task Publish_GivenQueryServiceThatThrows_ReturnsFalse() { var score = new ScoreView() { Id = Guid.NewGuid(), GameId = _gameId, Name = "Test User", Score = 5, PostedAt = DateTime.UtcNow, }; _gameViewQueryMock.Setup(s => s.Get(It.IsAny <Guid>(), It.IsAny <int>(), It.IsAny <int>())).Throws <Exception>(); Assert.That(await _publisher.Publish(score), Is.False); }
public async Task Publish_GivenModelThatThrows_ReturnsFalse() { var score = new ScoreView() { Id = Guid.NewGuid(), GameId = _gameId, Name = "Test User", Score = 5, PostedAt = DateTime.UtcNow, }; _modelMock.Setup(m => m.CreateBasicProperties()).Throws <Exception>(); Assert.That(await _publisher.Publish(score), Is.False); }
public async Task Publish_GivenConnectionThatThrows_ReturnsFalse() { var score = new ScoreView() { Id = Guid.NewGuid(), GameId = _gameId, Name = "Test User", Score = 5, PostedAt = DateTime.UtcNow, }; _connectionMock.Setup(c => c.CreateModel()).Throws <Exception>(); Assert.That(await _publisher.Publish(score), Is.False); }
private async void Score_OnTapped(object sender, EventArgs e) { TurnOnButton(_scoreLink); using (UserDialogs.Instance.Loading("loading")) { await Task.Delay(1); PageTitle.Text = "Health Score"; ContentStackLayout.Children.Clear(); var view1 = new ScoreView(); await view1.InitHealthScoreDetailPage(); ContentStackLayout.Children.Add(view1); } }
public HUD(ContentManager content, Score score, Stats stats) { var font = content.Load <SpriteFont>("Fonts/Default"); _scoreView = new ScoreView(score, font) { Colour = Color.Black, Position = new Vector2(Game1.screenWidth / 2, 20), }; _statsView = new StatsView(stats, font) { Colour = Color.Black, Position = new Vector2(Game1.screenWidth / 2, 60), }; }
public async Task Publish_GivenValidScoreView_CorrectlyPublishesViewDataAndReturnsTrue() { var score = new ScoreView() { Id = Guid.NewGuid(), GameId = _gameId, Name = "Test User", Score = 5, PostedAt = DateTime.UtcNow, }; Assert.That(await _publisher.Publish(score), Is.True); _connectionMock.Verify(c => c.CreateModel(), Times.Once, "CreateModel was not called once."); _modelMock.Verify(m => m.ExchangeDeclare(_exchangeName, ExchangeType.Fanout, false, false, null), Times.Once, "ExchangeDeclare was not called once."); _modelMock.Verify(m => m.BasicPublish(_exchangeName, "score-data", false, It.IsNotNull <IBasicProperties>(), It.IsAny <ReadOnlyMemory <byte> >()), Times.Once, "BasicPublish was not called correctly."); }
public override void ViewDidLayoutSubviews() { base.ViewDidLayoutSubviews(); var marin = UIScreen.MainScreen.Bounds.Width * 0.056f; btnInfo.ContentEdgeInsets = new UIEdgeInsets(marin, marin, marin, marin); cnsTableViewHeight.Constant = TableView.ContentSize.Height; ScrollView.ContentSize = new CGSize(ScrollView.Frame.Width, TableView.Frame.Y + TableView.ContentSize.Height); ScoreView.LayoutSubviews(); Score.Font = UIFont.FromName("ProximaNova-Bold", SizeConstants.ScreenMultiplier * 24); lblScoreGroup.Font = UIFont.FromName("ProximaNova-Bold", SizeConstants.ScreenMultiplier * 14); lblScoreGroup.SizeToFit(); InvokeOnMainThread(() => { View.LayoutIfNeeded(); }); cnsTableViewHeight.Constant = TableView.ContentSize.Height; ScrollView.ContentSize = new CGSize(ScrollView.Frame.Width, TableView.Frame.Y + TableView.ContentSize.Height); var bezierPath = new UIBezierPath(); bezierPath.MoveTo(new CGPoint(ivTriangle.Layer.Bounds.GetMaxX(), ivTriangle.Layer.Bounds.Y)); bezierPath.AddLineTo(new CGPoint(ivTriangle.Layer.Bounds.GetMaxX(), ivTriangle.Layer.Bounds.GetMaxY() + 4)); bezierPath.AddLineTo(new CGPoint(ivTriangle.Layer.Bounds.X, ivTriangle.Layer.Bounds.GetMaxY() + 4)); bezierPath.AddLineTo(new CGPoint(ivTriangle.Layer.Bounds.X, ivTriangle.Layer.Bounds.GetMaxY())); bezierPath.ClosePath(); ivTriangle.Layer.AddSublayer(new CAShapeLayer { Frame = ivTriangle.Bounds, Path = bezierPath.CGPath, FillColor = UIColor.White.CGColor }); ivTriangle.Image = null; //ScrollToOffset(ScrollView); }
public int Run(string input = Input) { var memory = Input.Split(',').Select(s => BigInteger.Parse(s)).ToArray(); memory[0] = 2; // to play for free! var cpu = new IntCodeStateMachine(memory); var scoreView = new ScoreView(); var gameView = new SegmentDisplay(scoreView, new ConsoleGameView()); var gameInput = new AiGameInput(cpu); var game = new ArcadeProgram(cpu, gameView, gameInput); cpu.RunAll(); Console.Clear(); return(scoreView.FinalScore); }
private void NavigationView_SelectionChanged(NavigationView sender, NavigationViewSelectionChangedEventArgs args) { string item = ((NavigationViewItem)args.SelectedItem).Tag as string; if (item == "StudentView") { StudentView student = new StudentView(); FrameMain.Navigate(student.GetType()); } else if (item == "HomeView") { HomeView home = new HomeView(); FrameMain.Navigate(home.GetType()); } else if (item == "ScoreView") { ScoreView score = new ScoreView(); FrameMain.Navigate(score.GetType()); } }
private void Start() { if (!scoreViewPrefab) { scoreViewPrefab = Resources.Load("PlayerText") as ScoreView; } else if (!replayUIPrefab) { replayUIPrefab = Resources.Load("ReplayUI") as ReplayView; } currentViewPos = scoreViewPrefab.gameObject.transform.position; if (!parentLayoutGroup) { Debug.Log("Parent not specified, using defaultParent"); parentLayoutGroup = GameObject.FindObjectOfType <LayoutGroup>(); } GameApplication.Instance.GetService <IReplayService>().SetSceneController(this); StartServices(); }
private void Start() { PianoKeys.GetAllKeys().ForEach(e => { shouldKeyBeOn[e] = false; }); piano = GetComponent <PianoBuilder>(); crtHolder = new List <Coroutine>(); _midiDeviceController = GetComponent <MidiDeviceController>(); scoreView = GetComponent <ScoreView>(); noteDurations = new List <NoteDuration>(); foreach (var item in PianoKeys.GetAllKeys()) { pianoRollDict.Add(item, new List <GameObject>()); } var ws = PianoKeys.GetAllKeys().Where(e => e.color == KeyColor.White).ToList(); for (var i = 0; i < ws.Count(); i++) { colorDict[ws[i]] = MakeColorFromHex(0xffffff); } PianoKeys.GetAllKeys().Where(e => e.color == KeyColor.Black).ToList() .ForEach(e => colorDict[e] = MakeColorFromHex(0x0000ff)); }
public ScorePresenter() { scView = new ScoreView(); }
private async Task MoveCursor(TimeSpan position) { #if false //TODO: EWWW! Use FindBeat instead! for (int i = 0; i < Media.Beats.Count - 1; i++) { if (Media.Beats[i + 1].Time > position.TotalSeconds) { _beatIndex = i; break; } } for (int i = 0; i < Media.Sections.Count; i++) { if (Media.Sections[i].BeatIdx == _beatIndex) { _sectionIndex = i; break; } } #else FindBeat(position.TotalSeconds, 0, Media.Beats.Count); FindSection(_beatIndex, 0, Media.Sections.Count); #endif var track = (ScorePicker.SelectedItem as ScoreInfo).Track; var nodes = Media.ScoreNodes[track].Nodes; CursorBar.TranslationX = nodes[_beatIndex].X; var y = track.ScoreSystemInterval * (nodes[_beatIndex].Row); uint page = (uint)(y / ScoreImage.Height); if (page != PageIndex) { SetScorePage(page); } var yOffset = y % ScoreImage.Height; if (Device.macOS != Device.RuntimePlatform) { await ScoreView.ScrollToAsync(0, yOffset, false); } CursorFrame.TranslationY = yOffset; CursorBar.TranslationY = yOffset; #if false TimelineImage.Text = $"P: {position}\t" + $"S: {Player.State}\n" + $"X: {nodes[_beatIndex].X}\t" + $"Pg: {page}\t" + $"R: {nodes[_beatIndex].Row}\n" + $"M: {nodes[_beatIndex].Measure}\n" + $"TX: {CursorBar.TranslationX}\n" + $"TY: {CursorBar.TranslationY}\t" + $"Idx:{_beatIndex}\n" + $"BT: {Media.Beats[_beatIndex].Time}" ; //TimelineImage.Text = // $"H {Height}\n" + // $"HLO.H {HeaderLayout.Height}\n" + // $"SVW.H {ScoreView.Height}\n" + // $"HCB.H {HideControlsButton.Height}\n" + // $"CLO.H {ControlsLayout.Height}\n" + // $"FLO.H {FooterLayout.Height}"; #else TimelineImage.Text = $"{Media.Sections[_sectionIndex].Name}\n\n\n\n\n"; #endif }
void Awake() { instance = this; text = GetComponent <Text>(); }
void Awake() { _view = GetComponent <ScoreView>(); }
public ScoreController(ScoreView view, GameContext gameData) { _view = view; _globalGameData = gameData; }
void ReleaseDesignerOutlets() { if (AreaCollection != null) { AreaCollection.Dispose(); AreaCollection = null; } if (AreaCollectionHeight != null) { AreaCollectionHeight.Dispose(); AreaCollectionHeight = null; } if (BottomTabView != null) { BottomTabView.Dispose(); BottomTabView = null; } if (btnInfo != null) { btnInfo.Dispose(); btnInfo = null; } if (cnBgCenterX != null) { cnBgCenterX.Dispose(); cnBgCenterX = null; } if (cnsAreaCollectionTop != null) { cnsAreaCollectionTop.Dispose(); cnsAreaCollectionTop = null; } if (cnsTableViewHeight != null) { cnsTableViewHeight.Dispose(); cnsTableViewHeight = null; } if (ivBackground != null) { ivBackground.Dispose(); ivBackground = null; } if (ivProfileImage != null) { ivProfileImage.Dispose(); ivProfileImage = null; } if (ivTriangle != null) { ivTriangle.Dispose(); ivTriangle = null; } if (lblScoreGroup != null) { lblScoreGroup.Dispose(); lblScoreGroup = null; } if (LeaderboardButton != null) { LeaderboardButton.Dispose(); LeaderboardButton = null; } if (PointsAndStatsButton != null) { PointsAndStatsButton.Dispose(); PointsAndStatsButton = null; } if (Score != null) { Score.Dispose(); Score = null; } if (ScoreImage != null) { ScoreImage.Dispose(); ScoreImage = null; } if (ScoreView != null) { ScoreView.Dispose(); ScoreView = null; } if (ScrollView != null) { ScrollView.Dispose(); ScrollView = null; } if (TableView != null) { TableView.Dispose(); TableView = null; } if (TransactionsButton != null) { TransactionsButton.Dispose(); TransactionsButton = null; } if (vBgImgOverlay != null) { vBgImgOverlay.Dispose(); vBgImgOverlay = null; } if (vContent != null) { vContent.Dispose(); vContent = null; } if (vContentBackground != null) { vContentBackground.Dispose(); vContentBackground = null; } if (vScoreimageInset != null) { vScoreimageInset.Dispose(); vScoreimageInset = null; } if (vScoreLabelInset != null) { vScoreLabelInset.Dispose(); vScoreLabelInset = null; } if (vScoreViewAlignment != null) { vScoreViewAlignment.Dispose(); vScoreViewAlignment = null; } if (vScoreViewFooterAlignment != null) { vScoreViewFooterAlignment.Dispose(); vScoreViewFooterAlignment = null; } if (vScoreViewSplitter != null) { vScoreViewSplitter.Dispose(); vScoreViewSplitter = null; } if (vTriangleBorder != null) { vTriangleBorder.Dispose(); vTriangleBorder = null; } if (vTriangleBottomAlign != null) { vTriangleBottomAlign.Dispose(); vTriangleBottomAlign = null; } }
private void ScoreChangedCallback(int v) { ScoreView.SetScore(v); }
public ScorePresenter(ScoreView scoreView) { ScoreView = scoreView; }
public Renderer(Variant variant) { scoreView = new ScoreView(variant); roundsView = new RoundsView(variant); }