public MemberController(IMemberHelper memberHelper, IPlayerHelper playerHelper,
                         ApplicationDbContext dbContext)
 {
     this.memberHelper = memberHelper;
     this.playerHelper = playerHelper;
     this.dbContext    = dbContext;
 }
Example #2
0
 /// <summary>
 /// Provides access to the Entoarox Framework's <see cref="IPlayerHelper"/> API.
 /// </summary>
 /// <param name="helper">The <see cref="IModHelper"/> of the mod calling this method</param>
 /// <returns></returns>
 public static IPlayerHelper Player(this IModHelper helper)
 {
     if (_PlayerHelper == null)
     {
         _PlayerHelper = new PlayerHelper();
     }
     return(_PlayerHelper);
 }
 /// <summary>Provides access to the Entoarox Framework's <see cref="IPlayerHelper" /> API.</summary>
 /// <param name="helper">The <see cref="IModHelper" /> of the mod calling this method</param>
 public static IPlayerHelper Player(this IModHelper helper)
 {
     if (IModHelperExtensions.PlayerHelper == null)
     {
         IModHelperExtensions.PlayerHelper = new PlayerHelper(IModHelperExtensions.PlayerModifierHelper);
     }
     return(IModHelperExtensions.PlayerHelper);
 }
Example #4
0
 public SkillController(
     IPlayerHelper playerHelper,
     ISkillHelper skillHelper,
     ApplicationDbContext dbContext)
 {
     this.playerHelper = playerHelper;
     this.skillHelper  = skillHelper;
     this.dbContext    = dbContext;
 }
Example #5
0
 public override void Entry(IModHelper helper)
 {
     VersionChecker.AddCheck("FasterPaths", Version, "https://raw.githubusercontent.com/Entoarox/Stardew-SMAPI-mods/master/Projects/VersionChecker/FasterPaths.json");
     cfg = Helper.ReadConfig <ConfigFP>();
     GameEvents.UpdateTick += UpdateTick;
     helper.ConsoleCommands.Add("fp_info", "Gives info about the path you are currently standing on", this.CommandInfo);
     Modifiers = new FarmerModifier[10] {
         new FarmerModifier()
         {
             WalkSpeedModifier = cfg.woodFloorBoost, RunSpeedModifier = cfg.woodFloorBoost
         },
         new FarmerModifier()
         {
             WalkSpeedModifier = cfg.stoneFloorBoost, RunSpeedModifier = cfg.stoneFloorBoost
         },
         new FarmerModifier()
         {
             WalkSpeedModifier = cfg.weatheredFloorBoost, RunSpeedModifier = cfg.weatheredFloorBoost
         },
         new FarmerModifier()
         {
             WalkSpeedModifier = cfg.crystalFloorBoost, RunSpeedModifier = cfg.crystalFloorBoost
         },
         new FarmerModifier()
         {
             WalkSpeedModifier = cfg.strawFloorBoost, RunSpeedModifier = cfg.strawFloorBoost
         },
         new FarmerModifier()
         {
             WalkSpeedModifier = cfg.gravelPathBoost, RunSpeedModifier = cfg.gravelPathBoost
         },
         new FarmerModifier()
         {
             WalkSpeedModifier = cfg.woodPathBoost, RunSpeedModifier = cfg.woodPathBoost
         },
         new FarmerModifier()
         {
             WalkSpeedModifier = cfg.crystalPathBoost, RunSpeedModifier = cfg.crystalPathBoost
         },
         new FarmerModifier()
         {
             WalkSpeedModifier = cfg.cobblePathBoost, RunSpeedModifier = cfg.cobblePathBoost
         },
         new FarmerModifier()
         {
             WalkSpeedModifier = cfg.steppingStoneBoost, RunSpeedModifier = cfg.steppingStoneBoost
         }
     };
     PlayerHelper = EntoFramework.GetPlayerHelper();
     PlayerHelper.AddModifier(new FarmerModifier()
     {
         WalkSpeedModifier = cfg.walkSpeedBoost, RunSpeedModifier = cfg.runSpeedBoost
     });
 }
Example #6
0
        public void Play()
        {
            this._isPlayInProgress = true;

            foreach (var playerHelper in this._playerHelpers.Select(pg => pg.Value))
            {
                playerHelper.PlaceTokenOnBoard();
            }

            var           i                = 0;
            IPlayer       lastPlayer       = null;
            IPlayerHelper lastPlayerHelper = null;

            while (true)
            {
                if (i == this._playerHelpers.Count - 1)
                {
                    i = 0;
                }

                lastPlayer       = this._playerHelpers.Keys.ElementAt(i);
                lastPlayerHelper = this._playerHelpers.Values.ElementAt(i);

                lastPlayerHelper.Play();
                if (lastPlayerHelper.HasPlayerWon())
                {
                    foreach (var player in this._playerHelpers.Keys.Where(p => p != lastPlayer))
                    {
                        player.PlayFinished(false);
                    }

                    lastPlayer.PlayFinished(true);
                    break;
                }
            }

            this.Reset();
        }
 public InterestedController(IPlayerHelper playerHelper, IMemberHelper memberHelper)
 {
     this.playerHelper = playerHelper;
     this.memberHelper = memberHelper;
 }
Example #8
0
 public MemberHelper(ApplicationDbContext dbContext, IPlayerHelper playerHelper)
 {
     this.dbContext    = dbContext;
     this.playerHelper = playerHelper;
 }