Initial commit

This commit is contained in:
2025-02-22 11:32:47 -06:00
commit 0184b18ba9
6 changed files with 552 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>enable</Nullable>
<StartupObject>ALttPRandomizer.Program</StartupObject>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Azure.WebPubSub.AspNetCore" Version="1.4.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="7.2.0" />
<PackageReference Include="System.Text.Json" Version="9.0.2" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,12 @@
namespace ALttPRandomizer {
using ALttPRandomizer.Model;
using Microsoft.AspNetCore.Mvc;
public class GenerateController : Controller {
[Route("/generate")]
[HttpPost]
public ActionResult Generate(SeedSettings settings) {
return Content("Hello world");
}
}
}

View File

@@ -0,0 +1,71 @@
using System.ComponentModel.DataAnnotations;
namespace ALttPRandomizer.Model {
public class SeedSettings {
public Mode Mode { get; set; } = Mode.Open;
public Weapons Weapons { get; set; } = Weapons.Randomized;
public Goal Goal { get; set; } = Goal.Ganon;
public EntranceShuffle EntranceShuffle { get; set; } = EntranceShuffle.None;
public BossShuffle BossShuffle { get; set; } = BossShuffle.None;
public DungeonItemLocations SmallKeys { get; set; } = DungeonItemLocations.Dungeon;
[DeniedValues(DungeonItemLocations.Universal)]
public DungeonItemLocations BigKeys { get; set; } = DungeonItemLocations.Dungeon;
[DeniedValues(DungeonItemLocations.Universal)]
public DungeonItemLocations Maps { get; set; } = DungeonItemLocations.Dungeon;
[DeniedValues(DungeonItemLocations.Universal)]
public DungeonItemLocations Compasses { get; set; } = DungeonItemLocations.Dungeon;
}
public enum Mode {
Open,
Standard,
Inverted,
}
public enum Weapons {
Randomized,
Assured,
Vanilla,
Swordless,
}
public enum Goal {
Ganon,
FastGanon,
AllDungeons,
Pedestal,
TriforceHunt,
GanonHunt,
Completionist,
}
public enum EntranceShuffle {
None,
Full,
Crossed,
Decoupled,
}
public enum BossShuffle {
None,
Simple,
Full,
Random,
PrizeUnique,
}
public enum DungeonItemLocations {
Dungeon,
Wild,
Nearby,
Universal,
}
}

View File

@@ -0,0 +1,30 @@
namespace ALttPRandomizer
{
using System.Text.Json.Serialization;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
internal class Program
{
static void Main(string[] args)
{
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddControllers().AddJsonOptions(x =>
x.JsonSerializerOptions.Converters.Add(new JsonStringEnumConverter()));
builder.Services.AddSwaggerGen();
var app = builder.Build();
app.UseHttpsRedirection();
app.MapControllers();
app.UseSwagger();
app.UseSwaggerUI(c => {
c.ShowCommonExtensions();
c.EnableValidator();
});
app.Run();
}
}
}