void Start () { scoreEntry = new ScoringSystem.ScoreEntry (); scoring = gameObject.GetComponent<ScoringSystem>(); scoreEntry.name = PlayerPrefs.GetString("Name"); scoreEntry.score = PlayerPrefs.GetFloat ("ScoreFloat"); scoring.AddScoreIntoHighScore (scoreEntry); //on gameover screen //fix for time still being slowed after a gameover Time.timeScale = 1.0F; }
public void ManualScoreTest() { Instant pickupTime = InstantPattern.ExtendedIso.Parse("2018-01-02T12:34:24Z").GetValueOrThrow(); Instant nowTime = InstantPattern.ExtendedIso.Parse("2018-08-02T12:34:24Z").GetValueOrThrow(); IClock fakeClock = new FakeClock(nowTime); ScoringSystem diminishingScoring = ScoringSystem.GetScoringSystem("Diminishing"); MasterGame masterGame = new MasterGame(Guid.NewGuid(), "", "", new LocalDate(2018, 7, 13), new LocalDate(2018, 7, 13), null, null, new LocalDate(2018, 7, 13), null, 84.8095m, "", "", fakeClock.GetCurrentInstant(), false, false, false, fakeClock.GetCurrentInstant(), new List <MasterSubGame>(), new List <MasterGameTag>()); PublisherGame testGame = new PublisherGame(Guid.NewGuid(), Guid.NewGuid(), "", pickupTime, false, 83.8095m, false, null, new MasterGameYear(masterGame, 2018), null, null); decimal?fantasyPoints = testGame.CalculateFantasyPoints(diminishingScoring, fakeClock); Assert.AreEqual(13.8095m, fantasyPoints); }
public void TestGetQualifierScore_ShoulNotdReturnPoints_WhenGroupIsIncomplete() { string oneCorrect = @"[info] user = ""user1"" [stage-one] winners = [ [ ""Brasil"", ""Whatever"",], ] "; string actualbet = @"[info] user = ""user1"" [stage-one] winners = [ [ ""-"", ""-"",], ] "; var user = new Results(oneCorrect.ParseAsToml()); var actual = new Results(actualbet.ParseAsToml()); var s = new ScoringSystem(user, actual); s.GetQualifierScore().ShouldBe(0); }
public void Under20ScoreTest() { Instant pickupTime = InstantPattern.ExtendedIso.Parse("2018-01-02T12:34:24Z").GetValueOrThrow(); Instant nowTime = InstantPattern.ExtendedIso.Parse("2018-08-02T12:34:24Z").GetValueOrThrow(); IClock fakeClock = new FakeClock(nowTime); ScoringSystem StandardScoring = ScoringSystem.GetScoringSystem("Standard"); MasterGame masterGame = new MasterGame(Guid.NewGuid(), "", "", new LocalDate(2018, 4, 20), new LocalDate(2018, 4, 20), null, null, new LocalDate(2018, 4, 20), null, 15.8559m, "", "", fakeClock.GetCurrentInstant(), false, false, false, fakeClock.GetCurrentInstant(), new List <MasterSubGame>(), new List <MasterGameTag>()); PublisherGame testGame = new PublisherGame(Guid.NewGuid(), Guid.NewGuid(), "", pickupTime, false, null, false, null, new MasterGameYear(masterGame, 2018), null, null); decimal?fantasyPoints = testGame.CalculateFantasyPoints(StandardScoring, fakeClock); Assert.AreEqual(-54.1441m, fantasyPoints); }
public LeagueOptions(int standardGames, int gamesToDraft, int counterPicks, int freeDroppableGames, int willNotReleaseDroppableGames, int willReleaseDroppableGames, bool dropOnlyDraftGames, bool counterPicksBlockDrops, int minimumBidAmount, IEnumerable <LeagueTagStatus> leagueTags, DraftSystem draftSystem, PickupSystem pickupSystem, ScoringSystem scoringSystem, bool publicLeague) { StandardGames = standardGames; GamesToDraft = gamesToDraft; CounterPicks = counterPicks; FreeDroppableGames = freeDroppableGames; WillNotReleaseDroppableGames = willNotReleaseDroppableGames; WillReleaseDroppableGames = willReleaseDroppableGames; DropOnlyDraftGames = dropOnlyDraftGames; CounterPicksBlockDrops = counterPicksBlockDrops; MinimumBidAmount = minimumBidAmount; LeagueTags = leagueTags.ToList(); DraftSystem = draftSystem; PickupSystem = pickupSystem; ScoringSystem = scoringSystem; PublicLeague = publicLeague; }
public override void OnStart() { freestyleText.SetActive(true); freestyleUI.SetActive(true); recentMovesP1 = new List <TempMove>(); recentMovesP2 = new List <TempMove>(); inputCheck = GameObject.FindGameObjectWithTag("GameController").GetComponent <InputCheck>(); scoringSystem = GameObject.FindGameObjectWithTag("GameController").GetComponent <ScoringSystem>(); canvas = GameObject.Find("Canvas"); foreach (DiscoballRetract dr in canvas.GetComponentsInChildren <DiscoballRetract>()) { dr.Retract(); } foreach (FreestyleDiscoball dr in canvas.GetComponentsInChildren <FreestyleDiscoball>()) { dr.Extend(); } }
public decimal?CalculateFantasyPoints(IClock clock) { if (!MasterGame.MasterGame.IsReleased(clock)) { return(0m); } var basePoints = MasterGame.CalculateFantasyPoints(ScoringSystem.GetRoyaleScoringSystem(), false, clock, true); if (!basePoints.HasValue) { return(null); } var extraPoints = basePoints * AdvertisingMoney * 0.05m; var modifiedPoints = basePoints + extraPoints; return(modifiedPoints); }
private async Task <string> GetBaseScoringSystemNameAsync(ScoringSystem scoringSystem) { if (scoringSystem.ParentSystemId == null) { return(scoringSystem.Name); } Database.Entities.ScoringSystem currentSystem = await _dbContext.ScoringSystems.SingleAsync(s => s.Id == scoringSystem.ParentSystemId) .ConfigureAwait(false); while (currentSystem.ParentSystemId != null) { currentSystem = await _dbContext.ScoringSystems .SingleAsync(s => s.Id == currentSystem.ParentSystemId) .ConfigureAwait(false); } return(currentSystem.Name); }
public LeagueYear ToDomain(League league, IEnumerable <EligibilityOverride> eligibilityOverrides, IEnumerable <LeagueTagStatus> leagueTags) { DraftSystem draftSystem = Lib.Enums.DraftSystem.FromValue(DraftSystem); PickupSystem pickupSystem = Lib.Enums.PickupSystem.FromValue(PickupSystem); ScoringSystem scoringSystem = Lib.Domain.ScoringSystems.ScoringSystem.GetScoringSystem(ScoringSystem); LeagueOptions options = new LeagueOptions(StandardGames, GamesToDraft, CounterPicks, FreeDroppableGames, WillNotReleaseDroppableGames, WillReleaseDroppableGames, DropOnlyDraftGames, CounterPicksBlockDrops, MinimumBidAmount, leagueTags, draftSystem, pickupSystem, scoringSystem, league.PublicLeague); Instant?draftStartedTimestamp = null; if (DraftStartedTimestamp.HasValue) { draftStartedTimestamp = Instant.FromDateTimeUtc(DraftStartedTimestamp.Value); } return(new LeagueYear(league, Year, options, Lib.Enums.PlayStatus.FromValue(PlayStatus), eligibilityOverrides, draftStartedTimestamp)); }
public async Task DeleteScoringSystemAsync_NewSystem_RemovesFromDb() { var scoringSystem = new ScoringSystem { Id = Guid.NewGuid(), Name = "Hah" }; await _service.SaveScoringSystemAsync(scoringSystem); Assert.Contains(_context.ScoringSystems, (ss) => ss.Name == "Hah"); // Act again await _service.DeleteScoringSystemAsync(scoringSystem.Id); // Assert Assert.DoesNotContain(_context.ScoringSystems, (ss) => ss.Name == "Hah"); }
public static void Main() { var gamer = new Gamer { Name = "Player 1", Score = 291.32 }; var gamer2 = new Gamer { Name = "Player 2", Score = 4567.14 }; var gamer3 = new Gamer { Name = "Player 3", Score = 25.12 }; var gamer4 = new Gamer { Name = "Player 4", Score = 0.0 }; var gamer5 = new Gamer { Name = "Player 5", Score = 300 }; var gamer6 = new Gamer { Name = "Palyer 6", Score = 400 }; var gamer7 = new Gamer { Name = "Small Player", Score = 10000 }; var scoreManager = new ScoringSystem(); scoreManager.AddGamerInfo(gamer); scoreManager.AddGamerInfo(gamer2); scoreManager.AddGamerInfo(gamer3); scoreManager.AddGamerInfo(gamer4); scoreManager.AddGamerInfo(gamer5); scoreManager.AddGamerInfo(gamer6); scoreManager.AddGamerInfo(gamer7); scoreManager.DisplayScoreBoard(); Console.ReadKey(); }
public void Trigger() { if (Used) { return; } IGameObject newObject = null; switch (QuestionmarkBlockType) { case QuestionmarkBlockTypeEnums.Flower: newObject = new Flower(new Vector2(Location.X, Location.Y - 2)); SoundManager.Instance.PlayPowerUpAppearsSound(); break; case QuestionmarkBlockTypeEnums.GreenMushroom: newObject = new GreenMushroom(new Vector2(Location.X, Location.Y - 2)); SoundManager.Instance.PlayPowerUpAppearsSound(); break; case QuestionmarkBlockTypeEnums.RedMushroom: newObject = new RedMushroom(new Vector2(Location.X, Location.Y - 2)); SoundManager.Instance.PlayPowerUpAppearsSound(); break; case QuestionmarkBlockTypeEnums.Star: newObject = new Star(new Vector2(Location.X, Location.Y - 2)); SoundManager.Instance.PlayPowerUpAppearsSound(); break; default: coinAnimation.StartAnimation(); CoinSystem.Instance.AddCoin(); ScoringSystem.AddPointsForCoin(this); break; } if (newObject != null) { newObject.Location = new Vector2(Location.X, Location.Y - 2); GameUtilities.GameObjectManager.AddItem(newObject); } stateMachine.BeTriggered(); }
//=================================== //=================================== // INITIALIZATION //=================================== //=================================== void Start() { // connect to external modules guiManager = GetComponent <GuiManager>(); guiComponents = GetComponent <GuiComponents>(); levelManager = GetComponent <LevelManager>(); scoringSystem = GetComponent <ScoringSystem>(); // texture references from GuiManager buckHeadTexture = guiManager.buckHeadTexture; doeHeadTexture = guiManager.doeHeadTexture; fawnHeadTexture = guiManager.fawnHeadTexture; closeup1Texture = guiManager.closeup1Texture; closeup2Texture = guiManager.closeup2Texture; closeup3Texture = guiManager.closeup3Texture; closeup4Texture = guiManager.closeup4Texture; closeup5Texture = guiManager.closeup5Texture; closeup6Texture = guiManager.closeup6Texture; }
public decimal?GetFantasyPoints(ScoringSystem scoringSystem, bool counterPick, LocalDate currentDate) { if (!WillRelease()) { return(0m); } if (!MasterGame.IsReleased(currentDate)) { return(null); } if (MasterGame.CriticScore.HasValue) { return(scoringSystem.GetPointsForScore(MasterGame.CriticScore.Value, counterPick)); } return(null); }
public void Trigger() { if (Used) { return; } IGameObject newObject = null; switch (hiddenItem) { case ItemType.Flower: newObject = new FireFlower(new Vector2(Location.X, Location.Y - 2)); SoundManager.Instance.PlayMushStarSound(); break; case ItemType.UpMushroom: newObject = new UpMushroom(new Vector2(Location.X, Location.Y - 16)); SoundManager.Instance.PlayMushStarSound(); break; case ItemType.SuperMushroom: newObject = new SuperMushroom(new Vector2(Location.X, Location.Y - 16)); SoundManager.Instance.PlayMushStarSound(); break; case ItemType.Star: newObject = new Star(new Vector2(Location.X, Location.Y - 16)); SoundManager.Instance.PlayMushStarSound(); break; default: coinAnimation.StartAnimation(); CoinSystem.Instance.AddCoin(); ScoringSystem.AddPointsForCoin(this); break; } if (newObject != null) { GameObjectManager.itemList.Add(newObject); } stateMachine.BeTriggered(); }
public void Execute(IGameObject gameObject1, IGameObject gameObject2) { IMario mario = (IMario)gameObject1; IEnemy goomba = (IEnemy)gameObject2; if (mario.State.MarioShape == MarioState.MarioShapeEnums.Dead || !goomba.Alive) { return; } mario.Location = new Vector2(mario.Location.X, goomba.Location.Y - mario.Destination.Height + GameUtilities.SinglePixel); if (goomba.Alive) { mario.Velocity = new Vector2(mario.Velocity.X, GameUtilities.MarioBounceVelocity); ScoringSystem.PlayerScore(mario.Player).AddPointsForStompingEnemy(gameObject2); goomba.Terminate("TOP"); SoundManager.Instance.PlayStompSound(); } }
//=================================== //=================================== // INITIALIZATION //=================================== //=================================== void Start() { // connect to external modules guiComponents = GetComponent <GuiComponents>(); levelManager = GetComponent <LevelManager>(); scoringSystem = GetComponent <ScoringSystem>(); inputControls = GetComponent <InputControls>(); overlayPanel = GetComponent <OverlayPanel>(); infoPanel = GetComponent <InfoPanel>(); feedingDisplay = GetComponent <FeedingDisplay>(); gameplayDisplay = GetComponent <GameplayDisplay>(); // additional initialization SetGuiState("guiStateStartApp1"); infoPanelVisible = true; infoPanelTransStart = Time.time - 100000; customGUISkin.button.normal.textColor = new Color(0.90f, 0.65f, 0f, 1f); customGUISkin.button.hover.textColor = new Color(0.99f, 0.75f, 0.21f, 1f); }
public decimal?CalculateFantasyPoints(ScoringSystem scoringSystem, bool counterPick, IClock clock, bool mustBeReleased) { if (!WillRelease()) { return(0m); } if (mustBeReleased && !MasterGame.IsReleased(clock.GetCurrentInstant())) { return(null); } if (MasterGame.CriticScore.HasValue) { return(scoringSystem.GetPointsForScore(MasterGame.CriticScore.Value, counterPick)); } return(null); }
public decimal GetProjectedFantasyPoints(ScoringSystem scoringSystem, SystemWideValues systemWideValues, int standardGamesTaken, int numberOfStandardGames) { if (PublisherGame is null) { return(systemWideValues.GetEmptySlotAveragePoints(CounterPick, standardGamesTaken + 1, numberOfStandardGames)); } if (PublisherGame.MasterGame is null) { if (PublisherGame.ManualCriticScore.HasValue) { return(PublisherGame.ManualCriticScore.Value); } return(systemWideValues.GetEmptySlotAveragePoints(CounterPick, standardGamesTaken + 1, numberOfStandardGames)); } return(PublisherGame.MasterGame.GetProjectedFantasyPoints(scoringSystem, CounterPick)); }
public void TestGetStageOneMatchScore_ShouldReturnZero_WhenAllResultIsDifferent() { string userbet = @"[info] user = ""user1"" [stage-one] results = [ [ ""h"", ""h"", ""h"", ""u"", ""b"", ""b"",], [ ""h"", ""u"", ""h"", ""b"", ""b"", ""h"",], ] winners = [ [ ""Brasil"", ""Mexico"",], [ ""Spania"", ""Nederland"",], ] "; string actualbet = @"[info] user = ""user1"" [stage-one] results = [ [ ""b"", ""b"", ""b"", ""b"", ""h"", ""h"",], [ ""b"", ""b"", ""b"", ""h"", ""h"", ""b"",], ] winners = [ [ ""Brasil"", ""Mexico"",], [ ""Spania"", ""Nederland"",], ] "; var user = new Results(userbet.ParseAsToml()); var actual = new Results(actualbet.ParseAsToml()); var s = new ScoringSystem(user, actual); s.GetStageOneMatchScore().ShouldBe(0); }
public void Execute() { if (myhandler.mario.State.MarioShape == Shape.Dead || !myhandler.enemy.Alive) { return; } myhandler.mario.Location = new Vector2(myhandler.mario.Location.X, myhandler.enemy.Location.Y - myhandler.mario.Destination.Height + 1); if (myhandler.enemy.Alive) { if (!myhandler.mario.IsInWater) { myhandler.mario.Velocity = new Vector2(myhandler.mario.Velocity.X, GameData.marioBouncingSpeed); myhandler.enemy.Terminate("Top"); SoundManager.Instance.PlayStompSound(); ScoringSystem.AddPointsForStompingEnemy(myhandler.enemy); } else { myhandler.enemy.ChangeDirection(); switch (myhandler.mario.State.MarioShape) { case Shape.Small: myhandler.mario.State.Terminated(); break; case Shape.Big: myhandler.mario.IsProtected = true; myhandler.mario.State.MarioShapeChange(Shape.Small); SoundManager.Instance.PlayPipeSound(); break; case Shape.Fire: myhandler.mario.IsProtected = true; myhandler.mario.State.MarioShapeChange(Shape.Small); SoundManager.Instance.PlayPipeSound(); break; } } } }
public decimal GetProjectedOrRealFantasyPoints(ScoringSystem scoringSystem, SystemWideValues systemWideValues, bool simpleProjections, IClock clock) { if (MasterGame.HasNoValue) { return(systemWideValues.GetAveragePoints(CounterPick)); } decimal?fantasyPoints = CalculateFantasyPoints(scoringSystem, clock); if (fantasyPoints.HasValue) { return(fantasyPoints.Value); } if (simpleProjections) { return(MasterGame.Value.GetSimpleProjectedFantasyPoints(systemWideValues, CounterPick)); } return(MasterGame.Value.GetProjectedOrRealFantasyPoints(scoringSystem, CounterPick, clock)); }
public async Task SaveScoringSystemAsync(ScoringSystem scoringSystem) { if (scoringSystem.Id == Guid.Empty) { scoringSystem.Id = Guid.NewGuid(); } var dbObject = await _dbContext.ScoringSystems .Where(s => s.Id == scoringSystem.Id).SingleOrDefaultAsync() .ConfigureAwait(false); if (dbObject == null) { var newDbObject = _mapper.Map <Db.ScoringSystem>(scoringSystem); _dbContext.ScoringSystems.Add(newDbObject); } else { _mapper.Map(scoringSystem, dbObject); } await _dbContext.SaveChangesAsync().ConfigureAwait(false); }
public MasterGameYearViewModel(MasterSubGame masterSubGame, MasterGameYear masterGame, LocalDate currentDate) { MasterGameID = masterSubGame.MasterGameID; Year = masterGame.Year; GameName = masterSubGame.GameName; EstimatedReleaseDate = masterSubGame.EstimatedReleaseDate; MinimumReleaseDate = masterSubGame.MinimumReleaseDate; MaximumReleaseDate = masterSubGame.GetDefiniteMaximumReleaseDate(); ReleaseDate = masterGame.MasterGame.ReleaseDate; IsReleased = masterGame.MasterGame.IsReleased(currentDate); WillRelease = masterGame.WillRelease(); CriticScore = masterSubGame.CriticScore; FantasyPoints = masterGame.GetFantasyPoints(ScoringSystem.GetDefaultScoringSystem(Year), false, currentDate); AveragedScore = false; OpenCriticID = masterSubGame.OpenCriticID; SubGames = null; Tags = new List <string>(); ReadableTags = new List <string>(); PercentStandardGame = masterGame.PercentStandardGame; PercentCounterPick = masterGame.PercentCounterPick; AdjustedPercentCounterPick = masterGame.AdjustedPercentCounterPick; if (masterGame.MasterGame.EligibilityChanged) { EligiblePercentStandardGame = masterGame.PercentStandardGame; } else { EligiblePercentStandardGame = masterGame.EligiblePercentStandardGame; } AverageDraftPosition = masterGame.AverageDraftPosition; HypeFactor = masterGame.HypeFactor; DateAdjustedHypeFactor = masterGame.DateAdjustedHypeFactor; PeakHypeFactor = masterGame.PeakHypeFactor; ProjectedFantasyPoints = masterGame.GetProjectedFantasyPoints(ScoringSystem.GetDefaultScoringSystem(Year), false); ProjectedOrRealFantasyPoints = FantasyPoints ?? ProjectedFantasyPoints; AddedTimestamp = masterGame.MasterGame.AddedTimestamp; }
public EditLeagueYearParameters(FantasyCriticUser manager, Guid leagueID, int year, int standardGames, int gamesToDraft, int counterPicks, int freeDroppableGames, int willNotReleaseDroppableGames, int willReleaseDroppableGames, bool dropOnlyDraftGames, EligibilityLevel maximumEligibilityLevel, bool allowYearlyInstallments, bool allowEarlyAccess, bool allowFreeToPlay, bool allowReleasedInternationally, bool allowExpansions, DraftSystem draftSystem, PickupSystem pickupSystem, ScoringSystem scoringSystem, bool publicLeague) { Manager = manager; LeagueID = leagueID; Year = year; StandardGames = standardGames; GamesToDraft = gamesToDraft; CounterPicks = counterPicks; FreeDroppableGames = freeDroppableGames; WillNotReleaseDroppableGames = willNotReleaseDroppableGames; WillReleaseDroppableGames = willReleaseDroppableGames; DropOnlyDraftGames = dropOnlyDraftGames; AllowedEligibilitySettings = new EligibilitySettings(maximumEligibilityLevel, allowYearlyInstallments, allowEarlyAccess, allowFreeToPlay, allowReleasedInternationally, allowExpansions); DraftSystem = draftSystem; PickupSystem = pickupSystem; ScoringSystem = scoringSystem; PublicLeague = publicLeague; }
public EditLeagueYearParameters(FantasyCriticUser manager, Guid leagueID, int year, int standardGames, int gamesToDraft, int counterPicks, int freeDroppableGames, int willNotReleaseDroppableGames, int willReleaseDroppableGames, bool dropOnlyDraftGames, bool counterPicksBlockDrops, int minimumBidAmount, IEnumerable <LeagueTagStatus> leagueTags, DraftSystem draftSystem, PickupSystem pickupSystem, ScoringSystem scoringSystem, bool publicLeague) { Manager = manager; LeagueID = leagueID; Year = year; StandardGames = standardGames; GamesToDraft = gamesToDraft; CounterPicks = counterPicks; FreeDroppableGames = freeDroppableGames; WillNotReleaseDroppableGames = willNotReleaseDroppableGames; WillReleaseDroppableGames = willReleaseDroppableGames; DropOnlyDraftGames = dropOnlyDraftGames; CounterPicksBlockDrops = counterPicksBlockDrops; MinimumBidAmount = minimumBidAmount; LeagueTags = leagueTags.ToList(); DraftSystem = draftSystem; PickupSystem = pickupSystem; ScoringSystem = scoringSystem; PublicLeague = publicLeague; }
// Use this for initialization public override void OnStart() { timingP1 = timingObjectP1.GetComponent <SpriteRenderer>(); timingP2 = timingObjectP2.GetComponent <SpriteRenderer>(); lastMove = timingPairs[lastPairIndex].firstValue; nextInstruction.sprite = lastMove.moveInstruction; inputCheck = GameObject.FindGameObjectWithTag("GameController").GetComponent <InputCheck>(); scoringSystem = GameObject.FindGameObjectWithTag("GameController").GetComponent <ScoringSystem>(); if (timingPairs.Length == 0) { started = false; } instruction.sprite = timingPairs[lastPairIndex].firstValue.moveInstruction; timingP1.sprite = instruction.sprite; timingP1.gameObject.transform.localScale = new Vector3(scaleTiming, scaleTiming, 1); timingP2.gameObject.transform.localScale = timingP1.gameObject.transform.localScale; timingP2.sprite = timingP1.sprite; if (lastPairIndex + 1 <= timingPairs.Length - 1) { nextInstruction.sprite = timingPairs[lastPairIndex + 1].firstValue.moveInstruction; } else { nextInstruction.sprite = voidSprite; } timingP1.gameObject.transform.position = new Vector3(-3, -3.75f, 1); timingP2.gameObject.transform.position = new Vector3(3, -3.75f, 1); timingObjectP1Small.transform.position = timingP1.gameObject.transform.position; timingObjectP2Small.transform.position = timingP2.gameObject.transform.position; if (musicSource != null) { musicSource.Play(); } if (introTime > 0) { started = false; } }
public PublisherGameViewModel(PublisherGame publisherGame, IClock clock, ScoringSystem scoringSystem, SystemWideValues systemWideValues) { PublisherGameID = publisherGame.PublisherGameID; GameName = publisherGame.GameName; Timestamp = publisherGame.Timestamp.ToDateTimeUtc(); CounterPick = publisherGame.CounterPick; FantasyPoints = publisherGame.FantasyPoints; SimpleProjectedFantasyPoints = publisherGame.GetProjectedOrRealFantasyPoints(scoringSystem, systemWideValues, true, clock); AdvancedProjectedFantasyPoints = publisherGame.GetProjectedOrRealFantasyPoints(scoringSystem, systemWideValues, false, clock); Linked = publisherGame.MasterGame.HasValue; if (Linked) { GameName = publisherGame.MasterGame.Value.MasterGame.GameName; EstimatedReleaseDate = publisherGame.MasterGame.Value.MasterGame.EstimatedReleaseDate; if (publisherGame.MasterGame.Value.MasterGame.ReleaseDate.HasValue) { ReleaseDate = publisherGame.MasterGame.Value.MasterGame.ReleaseDate.Value.ToDateTimeUnspecified(); } CriticScore = publisherGame.MasterGame.Value.MasterGame.CriticScore; Released = publisherGame.MasterGame.Value.MasterGame.IsReleased(clock.GetCurrentInstant()); if (publisherGame.MasterGame.HasValue) { MasterGame = new MasterGameYearViewModel(publisherGame.MasterGame.Value, clock); } } if (publisherGame.ManualCriticScore.HasValue) { CriticScore = publisherGame.ManualCriticScore; ManualCriticScore = true; } WillRelease = publisherGame.WillRelease(); ManualWillNotRelease = publisherGame.ManualWillNotRelease; }
public LeagueYearParameters ToDomain(IReadOnlyDictionary <string, MasterGameTag> tagDictionary) { DraftSystem draftSystem = Lib.Enums.DraftSystem.FromValue(DraftSystem); PickupSystem pickupSystem = Lib.Enums.PickupSystem.FromValue(PickupSystem); TradingSystem tradingSystem = Lib.Enums.TradingSystem.FromValue(TradingSystem); TiebreakSystem tiebreakSystem = Lib.Enums.TiebreakSystem.FromValue(TiebreakSystem); ScoringSystem scoringSystem = Lib.Domain.ScoringSystems.ScoringSystem.GetScoringSystem(ScoringSystem); int freeDroppableGames = FreeDroppableGames; if (UnlimitedFreeDroppableGames) { freeDroppableGames = -1; } int willNotReleaseDroppableGames = WillNotReleaseDroppableGames; if (UnlimitedWillNotReleaseDroppableGames) { willNotReleaseDroppableGames = -1; } int willReleaseDroppableGames = WillReleaseDroppableGames; if (UnlimitedWillReleaseDroppableGames) { willReleaseDroppableGames = -1; } var counterPickDeadline = new AnnualDate(CounterPickDeadline.Month, CounterPickDeadline.Day); var leagueTags = Tags.ToDomain(tagDictionary); var specialGameSlots = SpecialGameSlots.Select(x => x.ToDomain(tagDictionary)); LeagueYearParameters parameters = new LeagueYearParameters(LeagueID, Year, StandardGames, GamesToDraft, CounterPicks, CounterPicksToDraft, freeDroppableGames, willNotReleaseDroppableGames, willReleaseDroppableGames, DropOnlyDraftGames, CounterPicksBlockDrops, MinimumBidAmount, leagueTags, specialGameSlots, draftSystem, pickupSystem, scoringSystem, tradingSystem, tiebreakSystem, counterPickDeadline); return(parameters); }
public BetterPageViewModel(ITournament t, IResults bet, IResults actual) { _tournament = t; _bet = bet; _results = actual; _userScore = new ScoringSystem(bet, actual); _totalScore = new ScoringSystem(actual, actual); CreateGroupMatches(); if (WorldCupRules) { CreateRound16Matches(); CreateQuarterFinalMatches(); CreateSemiFinalMatches(); CreateBronseFinalMatch(); } else { CreateEuroRound16Matches(); CreateEuroQuarterFinalMatches(); CreateEuroSemiFinalMatches(); } CreateFinalMatch(); }
public LeagueCreationParameters(FantasyCriticUser manager, string leagueName, int standardGames, int gamesToDraft, int counterPicks, int freeDroppableGames, int willNotReleaseDroppableGames, int willReleaseDroppableGames, bool dropOnlyDraftGames, bool counterPicksBlockDrops, int minimumBidAmount, int initialYear, IEnumerable <LeagueTagStatus> leagueTags, DraftSystem draftSystem, PickupSystem pickupSystem, ScoringSystem scoringSystem, bool publicLeague, bool testLeague) { Manager = manager; LeagueName = leagueName; StandardGames = standardGames; GamesToDraft = gamesToDraft; CounterPicks = counterPicks; FreeDroppableGames = freeDroppableGames; WillNotReleaseDroppableGames = willNotReleaseDroppableGames; WillReleaseDroppableGames = willReleaseDroppableGames; DropOnlyDraftGames = dropOnlyDraftGames; CounterPicksBlockDrops = counterPicksBlockDrops; MinimumBidAmount = minimumBidAmount; InitialYear = initialYear; LeagueTags = leagueTags.ToList(); DraftSystem = draftSystem; PickupSystem = pickupSystem; ScoringSystem = scoringSystem; PublicLeague = publicLeague; TestLeague = testLeague; }
// Use this for initialization void Start () { scoring = gameObject.GetComponent<ScoringSystem>(); }
void Start(){ GameObject scoreSystem = GameObject.FindGameObjectWithTag("MainCamera"); this.s = (ScoringSystem)scoreSystem.GetComponent("ScoringSystem"); }
void Start() { radius = new Vector3(1, 0, 0); currentRotation = 0.0f; gameGrid = new ScoreBoard(gameGroundLevel.transform, GameObject.FindGameObjectsWithTag("Obstacle")); count = 0; x = (int)(gameGroundLevel.transform.localScale.x * 10); z = (int)(gameGroundLevel.transform.localScale.z * 10); offset = new Vector3(gameGroundLevel.transform.position.x - x * 0.5f, 0, gameGroundLevel.transform.position.z - z * 0.5f); startButton.enabled = false; startButton.transform.position = new Vector3(0.5f, 0.5f, 1); PerspectiveEditingCam.enabled = false; score = new ScoringSystem(); score.InitializeScore(); }