1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Threading.Tasks;
- using Microsoft.AspNetCore.Mvc;
- using api.Data;
- namespace api.Controllers
- {
- [Route("api/[controller]")]
- [ApiController]
- public class ProgressController : ControllerBase
- {
- private Dictionary<string, object> progression;
- public ProgressController() {
- this.init();
- }
- void init() {
- progression = new Dictionary<string, object>();
- List<ProgressElement> startingProgress = new List<ProgressElement>();
- startingProgress.Add(new ProgressElement() {Name = "init", Unlocks = new List<string>() {}});
- startingProgress.Add(new ProgressElement() {Name = "repair", Unlocks = new List<string>() {"inventory"}});
- startingProgress.Add(new ProgressElement() {Name = "repairfail", Unlocks = new List<string>() {"crafting"}});
- startingProgress.Add(new ProgressElement() {Name = "craft", Unlocks = new List<string>() {}});
- startingProgress.Add(new ProgressElement() {Name = "repair2", Unlocks = new List<string>() {"navigation"}});
- startingProgress.Add(new ProgressElement() {Name = "navigatefail", Unlocks = new List<string>() {}});
- startingProgress.Add(new ProgressElement() {Name = "craft2", Unlocks = new List<string>() {}});
- startingProgress.Add(new ProgressElement() {Name = "done", Unlocks = new List<string>() {}});
- this.progression.Add("starting", startingProgress);
- }
- [HttpGet]
- public ActionResult<Dictionary<string, object>> Get()
- {
- return this.progression;
- }
- // GET api/progress/5
- [HttpGet("{id}")]
- public ActionResult<object> GetPlayerProgress(int id)
- {
- return new { starting = "init" };
- }
- // GET api/progress/advance/chain/id
- [HttpGet("advance/{chain}/{id}")]
- public ActionResult<object> AdvancePlayer(string chain, int id)
- {
- return new List<string>() { "next" };
- }
- }
- }
|