示例#1
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
                app.UseDatabaseErrorPage();
            }
            else
            {
                app.UseExceptionHandler("/Home/Error");
                // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
                app.UseHsts();
            }

            //app.UseHttpsRedirection();
            app.UseStaticFiles();

            app.UseAuthentication();

            app.UseMvc(routes =>
            {
                routes.MapRoute(
                    name: "default",
                    template: "{controller=Home}/{action=Index}/{id?}");
            });

            app.UseCookiePolicy();

            GMobsList.init();
            GItemsList.init();
            GWorld.init();
        }
示例#2
0
 public CMob(int id, int difficulty, string name, string description, string picture)
 {
     if (GMobsList.MobsList.ContainsKey(id))
     {
         throw new Exception("Mob already exist");
     }
     Id          = id;
     Difficulty  = difficulty;
     Name        = name;
     Description = description;
     Picture     = picture;
     GMobsList.Add(this);
 }