public EnhancedHUDDifficultyButton(int depth, FractionDifficulty diff, Action a)
        {
            Depth = depth;

            icon   = FractionDifficultyHelper.GetIcon(diff);
            action = a;
        }
Ejemplo n.º 2
0
        public string GetCustomLevelTimeString(long onlineID, FractionDifficulty diff)
        {
            var dat = GetCustomLevelData(onlineID);

            if (dat == null)
            {
                return(string.Empty);
            }

            switch (diff)
            {
            case FractionDifficulty.DIFF_0: return(dat.Diff0_HasCompleted ? TimeExtension.FormatMilliseconds(dat.Diff0_BestTime, true) : string.Empty);

            case FractionDifficulty.DIFF_1: return(dat.Diff1_HasCompleted ? TimeExtension.FormatMilliseconds(dat.Diff1_BestTime, true) : string.Empty);

            case FractionDifficulty.DIFF_2: return(dat.Diff2_HasCompleted ? TimeExtension.FormatMilliseconds(dat.Diff2_BestTime, true) : string.Empty);

            case FractionDifficulty.DIFF_3: return(dat.Diff3_HasCompleted ? TimeExtension.FormatMilliseconds(dat.Diff3_BestTime, true) : string.Empty);

            case FractionDifficulty.NEUTRAL:
            case FractionDifficulty.PLAYER:
            default:
                SAMLog.Error("PP::EnumSwitch_GCLTS", "diff: " + diff);
                return("?");
            }
        }
Ejemplo n.º 3
0
        public HUDDifficultyButton(int depth, FractionDifficulty diff, HUDDifficultyButtonMode mode, Action a)
        {
            Depth      = depth;
            difficulty = diff;

            icon   = FractionDifficultyHelper.GetIcon(diff);
            action = a;

            switch (mode)
            {
            case HUDDifficultyButtonMode.DEACTIVATED:
                BackgroundColor = FlatColors.ButtonHUD;
                ForegroundColor = FlatColors.BackgroundHUD;
                break;

            case HUDDifficultyButtonMode.UNLOCKANIMATION:
                BackgroundColor = FlatColors.ButtonHUD;
                ForegroundColor = FlatColors.SunFlower;
                AddOperation(new HUDDifficultyButtonGainOperation());
                AddOperation(new HUDDifficultyButtonBlinkingIconOperation());
                break;

            case HUDDifficultyButtonMode.ACTIVATED:
                BackgroundColor = FlatColors.BackgroundHUD2;
                ForegroundColor = FlatColors.SunFlower;
                AddOperation(new HUDDifficultyButtonBlinkingIconOperation());
                break;

            default:
                SAMLog.Error("HDB::EnumSwitch_CTR", "value: " + mode);
                break;
            }
        }
Ejemplo n.º 4
0
        public static TextureRegion2D GetIcon(FractionDifficulty d)
        {
            switch (d)
            {
            case FractionDifficulty.KI_EASY:
                return(Textures.TexDifficultyLine0);

            case FractionDifficulty.KI_NORMAL:
                return(Textures.TexDifficultyLine1);

            case FractionDifficulty.KI_HARD:
                return(Textures.TexDifficultyLine2);

            case FractionDifficulty.KI_IMPOSSIBLE:
                return(Textures.TexDifficultyLine3);

            case FractionDifficulty.NEUTRAL:
            case FractionDifficulty.PLAYER:
            default:
                SAMLog.Error("FRACDIFF::EnumSwitch_GI", "value = " + d);
                break;
            }

            SAMLog.Error("EnumSwitch_GI", "GetScore()", "FractionDifficultyHelper.GetIcon -> " + d);
            return(null);
        }
Ejemplo n.º 5
0
        private void CloseExtender(FractionDifficulty d)
        {
            if (State[(int)d] == BistateProgress.Open)
            {
                AddEntityOperation(new CloseNodeOperation(d));
            }
            else if (State[(int)d] == BistateProgress.Opening)
            {
                float initProgress = 0f;

                var progress = FindFirstOperationProgress(p => p.Name == "LevelNode::Open::" + (int)d);
                AbortAllOperations(p => p.Name == "LevelNode::Open::" + (int)d);
                AbortAllOperations(p => p.Name == "LevelNode::Open::" + (int)d + "#delay");
                if (progress != null)
                {
                    initProgress = 1 - progress.Value;
                }
                else
                {
                    initProgress = 0.9999f;
                }

                var o = AddEntityOperation(new CloseNodeOperation(d));

                if (initProgress > 0f)
                {
                    o.ForceSetProgress(initProgress);
                }
            }
        }
Ejemplo n.º 6
0
        public static float GetLaserMultiplicator(FractionDifficulty d)
        {
            switch (d)
            {
            case FractionDifficulty.PLAYER:
                return(MULTIPLICATOR_L_PLAYER);

            case FractionDifficulty.NEUTRAL:
                return(MULTIPLICATOR_L_NEUTRAL);

            case FractionDifficulty.KI_EASY:
                return(MULTIPLICATOR_L_COMPUTER_0);

            case FractionDifficulty.KI_NORMAL:
                return(MULTIPLICATOR_L_COMPUTER_1);

            case FractionDifficulty.KI_HARD:
                return(MULTIPLICATOR_L_COMPUTER_2);

            case FractionDifficulty.KI_IMPOSSIBLE:
                return(MULTIPLICATOR_L_COMPUTER_3);

            default:
                SAMLog.Error("EnumSwitch_GLM", "GetBulletMultiplicator()", "FractionDifficultyHelper.GetMultiplicator -> " + d);
                throw new ArgumentOutOfRangeException(nameof(d), d, null);
            }
        }
Ejemplo n.º 7
0
        public bool HasCustomLevelBeaten(long onlineID, FractionDifficulty diff)
        {
            var dat = GetCustomLevelData(onlineID);

            if (dat == null)
            {
                return(false);
            }

            switch (diff)
            {
            case FractionDifficulty.DIFF_0: return(dat.Diff0_HasCompleted);

            case FractionDifficulty.DIFF_1: return(dat.Diff1_HasCompleted);

            case FractionDifficulty.DIFF_2: return(dat.Diff2_HasCompleted);

            case FractionDifficulty.DIFF_3: return(dat.Diff3_HasCompleted);

            case FractionDifficulty.NEUTRAL:
            case FractionDifficulty.PLAYER:
            default:
                SAMLog.Error("PP::EnumSwitch_HCLB", "diff: " + diff);
                return(false);
            }
        }
Ejemplo n.º 8
0
		public GDGameScreen(MainGame game, GraphicsDeviceManager gdm, LevelFile bp, FractionDifficulty diff) : base(game, gdm)
		{
			blueprint = bp;
			difficulty = diff;

			Initialize();
		}
Ejemplo n.º 9
0
        public void SetCustomLevelCompleted(long oid, FractionDifficulty diff, int time)         // no save (!)
        {
            var dat = GetOrAddCustomLevelData(oid);

            switch (diff)
            {
            case FractionDifficulty.DIFF_0:
                dat.Diff0_BestTime     = time;
                dat.Diff0_HasCompleted = true;
                break;

            case FractionDifficulty.DIFF_1:
                dat.Diff1_BestTime     = time;
                dat.Diff1_HasCompleted = true;
                break;

            case FractionDifficulty.DIFF_2:
                dat.Diff2_BestTime     = time;
                dat.Diff2_HasCompleted = true;
                break;

            case FractionDifficulty.DIFF_3:
                dat.Diff3_BestTime     = time;
                dat.Diff3_HasCompleted = true;
                break;

            case FractionDifficulty.NEUTRAL:
            case FractionDifficulty.PLAYER:
            default:
                SAMLog.Error("PP::EnumSwitch_SCLC", "diff: " + diff);
                break;
            }
        }
Ejemplo n.º 10
0
		public HUDDifficultyButton(int depth, FractionDifficulty diff, HUDDifficultyButtonMode mode)
		{
			Depth = depth;
			difficulty = diff;

			icon = FractionDifficultyHelper.GetIcon(diff);

			switch (mode)
			{
				case HUDDifficultyButtonMode.DEACTIVATED:
					BackgroundColor = FlatColors.ButtonHUD;
					ForegroundColor = FlatColors.BackgroundHUD;
					break;
				case HUDDifficultyButtonMode.UNLOCKANIMATION:
					BackgroundColor = FlatColors.ButtonHUD;
					ForegroundColor = GDColors.GetColorForDifficulty(diff);
					AddHUDOperation(new HUDDifficultyButtonGainOperation());
					AddHUDOperation(new HUDBlinkingDifficultyButtonIconOperation());
					break;
				case HUDDifficultyButtonMode.ACTIVATED:
					BackgroundColor = FlatColors.BackgroundHUD2;
					ForegroundColor = GDColors.GetColorForDifficulty(diff);
					AddHUDOperation(new HUDBlinkingDifficultyButtonIconOperation());
					break;
			}
		}
Ejemplo n.º 11
0
        private bool IsCellActive(FractionDifficulty d, int idx)
        {
            bool active;

            if (solvedPerc[d] < 0.5f)
            {
                active = idx < FloatMath.Ceiling(solvedPerc[d] * 15);
            }
            else
            {
                active = idx <= FloatMath.Floor(solvedPerc[d] * 15);
            }

            if (FlickerTime > COLLAPSE_TIME)
            {
                return(active);
            }
            else
            {
                if (active)
                {
                    return(FloatMath.GetRandom() < (0.5f + FloatMath.FunctionEaseInOutCubic(FlickerTime / COLLAPSE_TIME) / 2f));
                }
                else
                {
                    return(FloatMath.GetRandom() < (0.5f - FloatMath.FunctionEaseInOutCubic(FlickerTime / COLLAPSE_TIME) / 2f));
                }
            }
        }
Ejemplo n.º 12
0
        public static string GetShortIdentifier(FractionDifficulty d)
        {
            switch (d)
            {
            case FractionDifficulty.PLAYER:
                return("P");

            case FractionDifficulty.NEUTRAL:
                return("N");

            case FractionDifficulty.KI_EASY:
                return("C0");

            case FractionDifficulty.KI_NORMAL:
                return("C1");

            case FractionDifficulty.KI_HARD:
                return("C2");

            case FractionDifficulty.KI_IMPOSSIBLE:
                return("C3");

            default:
                SAMLog.Error("EnumSwitch_GSI", "GetScore()", "FractionDifficultyHelper.GetShortIdentifier -> " + d);
                throw new ArgumentOutOfRangeException(nameof(d), d, null);
            }
        }
Ejemplo n.º 13
0
        private void OpenExtender(FractionDifficulty d)
        {
            if (State[(int)d] == BistateProgress.Closed)
            {
                float initProgress = 0f;

                State[(int)d] = BistateProgress.Opening;
                var o = AddEntityOperationDelayed(new OpenNodeOperation(d), EXTENDER_DELAY * (int)d);

                if (initProgress > 0f)
                {
                    o.ForceSetProgress(initProgress);
                }
            }
            else if (State[(int)d] == BistateProgress.Closing)
            {
                float initProgress = 0f;

                var progress = FindFirstOperationProgress(p => p.Name == "LevelNode::Close::" + (int)d);
                AbortAllOperations(p => p.Name == "LevelNode::Close::" + (int)d);
                AbortAllOperations(p => p.Name == "LevelNode::Close::" + (int)d + "#delay");
                if (progress != null)
                {
                    initProgress = 1 - progress.Value;
                }

                var o = AddEntityOperation(new OpenNodeOperation(d));

                if (initProgress > 0f)
                {
                    o.ForceSetProgress(initProgress);
                }
            }
        }
Ejemplo n.º 14
0
 public int GetTime(FractionDifficulty d)
 {
     if (!Data[d].HasCompleted)
     {
         return(0);
     }
     return(Data[d].BestTime);
 }
Ejemplo n.º 15
0
        private void SelectDiff(FractionDifficulty d)
        {
            SelectedDifficulty = d;

            _diffButton0.Selected = (FractionDifficulty.DIFF_0 == SelectedDifficulty);
            _diffButton1.Selected = (FractionDifficulty.DIFF_1 == SelectedDifficulty);
            _diffButton2.Selected = (FractionDifficulty.DIFF_2 == SelectedDifficulty);
            _diffButton3.Selected = (FractionDifficulty.DIFF_3 == SelectedDifficulty);
        }
Ejemplo n.º 16
0
		private Fraction(Color c, Fraction nfrac, FractionType type, float mult, FractionDifficulty diff)
		{
			Color = c;
			Type = type;
			Difficulty = diff;
			neutralFraction = (Type == FractionType.NeutralFraction) ? this : nfrac;
			Multiplicator = mult;
			BackgroundColor = IsNeutral ? Color.Magenta : ColorMath.Blend(FlatColors.Background, c, 0.25f);
		}
Ejemplo n.º 17
0
        public void SetCompleted(Guid levelid, FractionDifficulty d, int time, bool upload)
        {
            GetLevelData(levelid).SetBestTime(d, time);

            if (upload && OnlineUserID >= 0)
            {
                MainGame.Inst.Backend.SetScore(this, levelid, d, time).EnsureNoError();
            }
        }
Ejemplo n.º 18
0
		public void ShowScorePanel(PlayerProfile.PlayerProfile profile, FractionDifficulty? newDifficulty, bool playerHasWon)
		{
			btnPause.IsEnabled = false;
			btnSpeed.IsEnabled = false;

			GDOwner.GameSpeedMode = GameSpeedModes.NORMAL;

			AddElement(new HUDScorePanel(profile, newDifficulty, playerHasWon));
		} 
Ejemplo n.º 19
0
        public HUDSCCMScorePanel_Lost(LevelBlueprint lvl, FractionDifficulty d)
        {
            _level             = lvl;
            SelectedDifficulty = d;

            RelativePosition = FPoint.Zero;
            Size             = new FSize(WIDTH, HEIGHT);
            Alignment        = HUDAlignment.CENTER;
            Background       = FlatColors.BackgroundHUD;
        }
Ejemplo n.º 20
0
 public static Fraction CreateComputerFraction(Color c, Fraction neutral, FractionDifficulty diff, bool slow)
 {
     return(new Fraction(
                c,
                neutral,
                FractionType.ComputerFraction,
                FractionDifficultyHelper.GetBulletMultiplicator(diff, slow),
                FractionDifficultyHelper.GetLaserMultiplicator(diff),
                diff));
 }
Ejemplo n.º 21
0
 private Fraction(Color c, Fraction nfrac, FractionType type, float multBullet, float multLaser, FractionDifficulty diff)
 {
     Color               = c;
     Type                = type;
     Difficulty          = diff;
     neutralFraction     = (Type == FractionType.NeutralFraction) ? this : nfrac;
     BulletMultiplicator = multBullet;
     LaserMultiplicator  = multLaser;
     BackgroundColor     = IsNeutral ? Color.Magenta : ColorMath.Blend(FlatColors.Background, c, 0.25f);
 }
Ejemplo n.º 22
0
        public static NodeBlueprint?FindNextNode(GraphBlueprint g, Guid idnode, FractionDifficulty d)
        {
            var snode = Get(g, idnode);

            if (snode == null)
            {
                return(null);
            }

            return(FindNextNode(g, snode, d));
        }
Ejemplo n.º 23
0
        public HUDSCCMScorePanel_Transmit(LevelBlueprint lvl, FractionDifficulty d, int time)
        {
            _level      = lvl;
            _difficulty = d;
            _time       = time;

            RelativePosition = FPoint.Zero;
            Size             = new FSize(WIDTH, HEIGHT);
            Alignment        = HUDAlignment.CENTER;
            Background       = FlatColors.BackgroundHUD;
        }
Ejemplo n.º 24
0
        public string GetTimeString(FractionDifficulty d, bool forceMinutes)
        {
            var v = Data[d];

            if (!v.HasCompleted)
            {
                return(string.Empty);
            }

            return(TimeExtension.FormatMilliseconds(v.BestTime, forceMinutes));
        }
Ejemplo n.º 25
0
        public void SetLevelScreen(LevelBlueprint blueprint, FractionDifficulty d, GraphBlueprint source, GameSpeedModes?speed = null)
        {
            var scrn = new GDGameScreen_SP(this, Graphics, blueprint, d, source);

            if (speed != null)
            {
                scrn.GameSpeedMode = speed.Value;
                scrn.UpdateGameSpeed();
            }
            SetCurrentScreen(scrn);
        }
Ejemplo n.º 26
0
		public HUDScorePanel(PlayerProfile.PlayerProfile playerprofile, FractionDifficulty? newDifficulty, bool playerHasWon)
		{
			gainLevel = newDifficulty;
			successScreen = playerHasWon;
			profile = playerprofile;

			RelativePosition = FPoint.Zero;
			Size = new FSize(WIDTH, HEIGHT);
			Alignment = HUDAlignment.CENTER;
			Background = FlatColors.BackgroundHUD;
		}
Ejemplo n.º 27
0
        public HUDSCCMTestScorePanel(LevelBlueprint lvl, SCCMLevelData dat, FractionDifficulty d, GameSpeedModes s, int t)
        {
            Level    = lvl;
            SCCMData = dat;
            Diff     = d;
            Speed    = s;
            Time     = t;

            RelativePosition = FPoint.Zero;
            Size             = new FSize(WIDTH, HEIGHT);
            Alignment        = HUDAlignment.CENTER;
            Background       = FlatColors.BackgroundHUD;
        }
Ejemplo n.º 28
0
        protected GDGameScreen(MainGame game, GraphicsDeviceManager gdm, LevelBlueprint bp, FractionDifficulty diff, bool prev, bool netw, bool slow)
            : base(game, gdm)
        {
            Blueprint  = bp;
            Difficulty = diff;
            IsPreview  = prev;
            IsNetwork  = netw;

            _superslow = slow;

            LaserNetwork = new LaserNetwork(GetPhysicsWorld(), this, (GameWrapMode)bp.WrapMode);

            Initialize();
        }
Ejemplo n.º 29
0
        public int TimeDisplayMode = 1;         // (PB, WR, CURR)

        public HUDSCCMScorePanel_Won(LevelBlueprint lvl, SCCMLevelMeta meta, FractionDifficulty d, int scoreGain, int time)
        {
            _level             = lvl;
            LevelMeta          = meta;
            LevelDifficulty    = d;
            SelectedDifficulty = d;
            _scoreGain         = scoreGain;
            PersonalTimes      = MainGame.Inst.Profile.GetCustomLevelTimes(meta.OnlineID);
            LevelTime          = time;

            RelativePosition = FPoint.Zero;
            Size             = new FSize(WIDTH, HEIGHT);
            Alignment        = HUDAlignment.CENTER;
            Background       = FlatColors.BackgroundHUD;
        }
Ejemplo n.º 30
0
        public HUDScorePanel(LevelBlueprint lvl, PlayerProfile playerprofile, HashSet <FractionDifficulty> newDifficulties, FractionDifficulty d, bool playerHasWon, int pointInc, int time)
        {
            _gainLevel       = newDifficulties;
            _successScreen   = playerHasWon;
            _profile         = playerprofile;
            _increasePoints  = pointInc;
            _level           = lvl;
            _levelDifficulty = d;
            _leveltime       = time;

            RelativePosition = FPoint.Zero;
            Size             = new FSize(WIDTH, HEIGHT);
            Alignment        = HUDAlignment.CENTER;
            Background       = FlatColors.BackgroundHUD;
        }
Ejemplo n.º 31
0
		public static Color GetColorForDifficulty(FractionDifficulty d)
		{
			switch (d)
			{
				case FractionDifficulty.KI_EASY:
					return COLOR_DIFFICULTY_0;
				case FractionDifficulty.KI_NORMAL:
					return COLOR_DIFFICULTY_1;
				case FractionDifficulty.KI_HARD:
					return COLOR_DIFFICULTY_2;
				case FractionDifficulty.KI_IMPOSSIBLE:
					return COLOR_DIFFICULTY_3;
				default:
					throw new ArgumentOutOfRangeException(nameof(d), d, null);
			}
		}
Ejemplo n.º 32
0
		public static TextureRegion2D GetIcon(FractionDifficulty d)
		{
			switch (d)
			{
				case FractionDifficulty.KI_EASY:
					return Textures.TexDifficulty0;
				case FractionDifficulty.KI_NORMAL:
					return Textures.TexDifficulty1;
				case FractionDifficulty.KI_HARD:
					return Textures.TexDifficulty2;
				case FractionDifficulty.KI_IMPOSSIBLE:
					return Textures.TexDifficulty3;
			}

			return null;
		}
Ejemplo n.º 33
0
        public void SetBestTime(FractionDifficulty d, int?time)
        {
            if (time == null)
            {
                Data[d].HasCompleted = false;
            }
            else
            {
                if (Data[d].HasCompleted && Data[d].BestTime < time.Value)
                {
                    time = Data[d].BestTime;
                }

                Data[d].HasCompleted = true;
                Data[d].BestTime     = time.Value;
            }
        }
Ejemplo n.º 34
0
        private void SelectDiff(FractionDifficulty d)
        {
            SelectedDifficulty = d;
            if (SelectedDifficulty == LevelDifficulty && TimeDisplayMode == 2)
            {
                TimeDisplayMode = 0;
            }
            UpdateTDMLabels();

            _diffButton0.Selected = (FractionDifficulty.DIFF_0 == SelectedDifficulty);
            _diffButton1.Selected = (FractionDifficulty.DIFF_1 == SelectedDifficulty);
            _diffButton2.Selected = (FractionDifficulty.DIFF_2 == SelectedDifficulty);
            _diffButton3.Selected = (FractionDifficulty.DIFF_3 == SelectedDifficulty);

            _btnReplay.L10NText = (LevelDifficulty == SelectedDifficulty) ? L10NImpl.STR_HSP_AGAIN :  L10NImpl.STR_LVLED_BTN_PLAY;
            _btnReplay.Icon     = (LevelDifficulty == SelectedDifficulty) ? Textures.TexIconRedo : Textures.TexHUDIconPlay;
        }
Ejemplo n.º 35
0
        private void SpawnOrb(LevelNode me, int cycle)
        {
            if (!NextLinkedNodes.Any())
            {
                return;
            }
            if (!MainGame.Inst.Profile.EffectsEnabled)
            {
                return;
            }

            FractionDifficulty d = FractionDifficulty.NEUTRAL;

            switch (cycle % 4)
            {
            case 0: d = FractionDifficulty.DIFF_0; break;

            case 1: d = FractionDifficulty.DIFF_1; break;

            case 2: d = FractionDifficulty.DIFF_2; break;

            case 3: d = FractionDifficulty.DIFF_3; break;

            default:
                SAMLog.Error("LN::EnumSwitch_SO", "value: " + (cycle % 4));
                break;
            }

            if (!LevelData.HasCompletedOrBetter(d))
            {
                d = FractionDifficulty.NEUTRAL;
            }

            foreach (var t in OutgoingPipes)
            {
                if (!((GameEntity)t.NodeSource).IsInViewport && !((GameEntity)t.NodeSink).IsInViewport)
                {
                    return;
                }

                var orb = new ConnectionOrb(Owner, t, d);

                Manager.AddEntity(orb);
            }
        }
Ejemplo n.º 36
0
        public bool HasCompletedExact(FractionDifficulty d)
        {
            switch (d)
            {
            case FractionDifficulty.DIFF_0: return(Diff0_HasCompleted);

            case FractionDifficulty.DIFF_1: return(Diff1_HasCompleted);

            case FractionDifficulty.DIFF_2: return(Diff2_HasCompleted);

            case FractionDifficulty.DIFF_3: return(Diff3_HasCompleted);

            case FractionDifficulty.NEUTRAL:
            case FractionDifficulty.PLAYER:
            default:
                SAMLog.Error("CLD::HasCompletedExact", "Invalid value: " + d);
                return(false);
            }
        }
Ejemplo n.º 37
0
        private void DrawInfoLine(IBatchRenderer sbatch, FractionDifficulty d, int idx, string strTime, bool colorize)
        {
            var p1 = Position + new Vector2(32, HEADER_HEIGHT + 40 + 56 * idx);
            var p2 = Position + new Vector2(64, HEADER_HEIGHT + 40 + 56 * idx);
            var p3 = Position + new Vector2(224, HEADER_HEIGHT + 40 + 56 * idx);

            var ic = (node.LevelData.HasCompletedOrBetter(d) ? FractionDifficultyHelper.GetColor(d) : FlatColors.Concrete) * progressDisplay;
            var tc = (node.LevelData.HasCompletedOrBetter(d) ? FlatColors.TextHUD : FlatColors.Asbestos) * progressDisplay;

            if (colorize && node.LevelData.Data[d].GlobalBestUserID >= 0 && node.LevelData.Data[d].GlobalBestUserID == MainGame.Inst.Profile.OnlineUserID)
            {
                tc = FlatColors.SunFlower * progressDisplay;
            }

            sbatch.DrawCentered(Textures.TexCircle, p1, 48, 48, FlatColors.WetAsphalt * progressDisplay);
            sbatch.DrawCentered(FractionDifficultyHelper.GetIcon(d), p1, 32, 32, ic);
            FontRenderHelper.DrawTextVerticallyCentered(sbatch, Textures.HUDFontRegular, 32, FractionDifficultyHelper.GetDescription(d), tc, p2);
            FontRenderHelper.DrawTextVerticallyCentered(sbatch, Textures.HUDFontRegular, 32, strTime, tc, p3);
        }
Ejemplo n.º 38
0
		public const float MULTIPLICATOR_COMPUTER_3 = 1.000f;  // Impossible

		public static float GetMultiplicator(FractionDifficulty d)
		{
			switch (d)
			{
				case FractionDifficulty.PLAYER:
					return MULTIPLICATOR_PLAYER;
				case FractionDifficulty.NEUTRAL:
					return MULTIPLICATOR_NEUTRAL;
				case FractionDifficulty.KI_EASY:
					return MULTIPLICATOR_COMPUTER_0;
				case FractionDifficulty.KI_NORMAL:
					return MULTIPLICATOR_COMPUTER_1;
				case FractionDifficulty.KI_HARD:
					return MULTIPLICATOR_COMPUTER_2;
				case FractionDifficulty.KI_IMPOSSIBLE:
					return MULTIPLICATOR_COMPUTER_3;
				default:
					throw new ArgumentOutOfRangeException(nameof(d), d, null);
			}
		}
Ejemplo n.º 39
0
		public static string GetShortIdentifier(FractionDifficulty d)
		{
			switch (d)
			{
				case FractionDifficulty.PLAYER:
					return "P";
				case FractionDifficulty.NEUTRAL:
					return "N";
				case FractionDifficulty.KI_EASY:
					return "C0";
				case FractionDifficulty.KI_NORMAL:
					return "C1";
				case FractionDifficulty.KI_HARD:
					return "C2";
				case FractionDifficulty.KI_IMPOSSIBLE:
					return "C3";
				default:
					throw new ArgumentOutOfRangeException(nameof(d), d, null);
			}
		}
		public bool HasCompleted(FractionDifficulty d)
		{
			return completedDifficulties.Contains(d);
		}
		public void SetCompleted(FractionDifficulty d)
		{
			completedDifficulties.Add(d);
		}
Ejemplo n.º 42
0
		public static Fraction CreateComputerFraction(Color c, Fraction neutral, FractionDifficulty diff)
		{
			return new Fraction(c, neutral, FractionType.ComputerFraction, FractionDifficultyHelper.GetMultiplicator(diff), diff);
		}