Browse Source

Web page data refactor

main
Jonathan 11 months ago
parent
commit
cf3f6e647b
  1. 51
      IGP/PageLayout.razor
  2. 387
      Model/Entity/Data/EntityData.Misc.cs
  3. 385
      Model/Entity/Data/EntityData.cs
  4. 53
      Model/Website/Data/EntityData.cs
  5. 7
      Model/Website/WebPageModel.cs
  6. 1
      Services/Website/WebsiteService.cs

51
IGP/PageLayout.razor

@ -3,16 +3,15 @@
@inject IWebsiteService WebService
@inject IDataCollectionService DataCollectionService
@inject NavigationManager NavigationManager
@using Model.Website.Data
@using Services.Website
@implements IDisposable
<MudThemeProvider @ref="@_mudThemeProvider" @bind-IsDarkMode="@_isDarkMode"/>
<MudPopoverProvider/>
<MudDialogProvider/>
<MudSnackbarProvider/>
<MudLayout>
<MudAppBar Elevation="1">
<MudHidden Breakpoint="Breakpoint.SmAndDown" Invert="true">
@ -27,35 +26,16 @@
<MudText Typo="Typo.h5"> IGP Fan Reference</MudText>
</MudButton>
<MudHidden Breakpoint="Breakpoint.MdAndUp" Invert="true">
<MudButton Href="/build-calculator"
Variant="Variant.Text"
Color="Color.Default"
Class="mr-4">
<MudIcon Icon="fa-solid fa-helmet-battle" Class="mr-2"/>
Build Calculator
</MudButton>
<MudButton Href="/harass-calculator"
Variant="Variant.Text"
Color="Color.Default"
Class="mr-4">
<MudIcon Icon="fa-solid fa-bow-arrow" Class="mr-2"/>
Harass Calculator
</MudButton>
<MudButton Href="/database"
Variant="Variant.Text"
Color="Color.Default"
Class="mr-4">
<MudIcon Icon="fa-solid fa-clipboard-list" Class="mr-2"/>
Database
</MudButton>
<MudButton Href="/data-tables"
Variant="Variant.Text"
Color="Color.Default"
Class="mr-4">
<MudIcon Icon="fa-solid fa-table-list" Class="mr-2"/>
Data Tables
</MudButton>
@foreach (var page in WebsiteData.GetPages())
{
<MudButton Href="@(page.Href)"
Variant="Variant.Text"
Color="Color.Default"
Class="mr-4">
<MudIcon Icon="@(page.Icon)" Class="mr-2"/>
@(page.Name)
</MudButton>
}
</MudHidden>
<MudSpacer/>
<SearchButtonComponent Id="desktop-searchButton"/>
@ -64,11 +44,10 @@
<MudDrawer @bind-Open="_drawerOpen" ClipMode="DrawerClipMode.Always" Elevation="2">
<MudPaper Width="250px" Class="d-inline-flex py-3" Elevation="0">
<MudNavMenu Class="mud-width-full flex-grow-1">
<MudNavLink Href="/build-calculator" Icon="fa-solid fa-helmet-battle">Build Calculator</MudNavLink>
<MudNavLink Href="/harass-calculator" Icon="fa-solid fa-bow-arrow">Harass Calculator</MudNavLink>
<MudNavLink Href="/database" Icon="fa-solid fa-clipboard-list">Database</MudNavLink>
<MudSpacer/>
<MudDivider Class="my-2"/>
@foreach (var page in WebsiteData.GetPages())
{
<MudNavLink Href="@(page.Href)" Icon="@(page.Icon)">@(page.Name)</MudNavLink>
}
</MudNavMenu>
</MudPaper>
</MudDrawer>

387
Model/Entity/Data/EntityData.Misc.cs

@ -0,0 +1,387 @@
using System.Collections.Generic;
using Model.Entity.Parts;
using Model.Entity.Types;
using Model.Types;
namespace Model.Entity.Data;
public partial class EntityData
{
public static Dictionary<string, EntityModel> GetMiscData()
{
return new Dictionary<string, EntityModel>
{
// Neutrals
// Pyre Events
{
DataType.PYREEVENT_CampTaken, new EntityModel(DataType.PYREEVENT_CampTaken, EntityType.Pyre_Event)
.AddPart(new EntityInfoModel { Name = "Pyre Camp", Description = "Provides 25 when taken." })
.AddPart(new EntityPyreRewardModel { BaseReward = 25 })
.AddPart(new EntityHotkeyModel { Hotkey = "E", HotkeyGroup = "2" })
},
{
DataType.PYREEVENT_MinerTaken, new EntityModel(DataType.PYREEVENT_MinerTaken, EntityType.Pyre_Event)
.AddPart(new EntityInfoModel { Name = "Pyre Camp", Description = "Provides 90 when taken." })
.AddPart(new EntityPyreRewardModel
{ BaseReward = 0, OverTimeRewardDuration = 90, OverTimeReward = 1 })
.AddPart(new EntityHotkeyModel { Hotkey = "Q", HotkeyGroup = "2" })
},
{
DataType.PYREEVENT_TowerKilled, new EntityModel(DataType.PYREEVENT_TowerKilled, EntityType.Pyre_Event)
.AddPart(new EntityInfoModel { Name = "Tower Taken", Description = "Provides 10 when destroyed." })
.AddPart(new EntityPyreRewardModel { BaseReward = 10 })
.AddPart(new EntityHotkeyModel { Hotkey = "R", HotkeyGroup = "2" })
},
// TEAPOTS
{
DataType.TEAPOT_Teapot, new EntityModel(DataType.TEAPOT_Teapot, EntityType.Teapot)
.AddPart(new EntityInfoModel
{
Name = "Teapot", Description = "Basic scout. Every faction has this",
Notes = @"Very powerful! So Fast"
})
.AddPart(new EntityVitalityModel { Health = 120, Armor = ArmorType.Light })
.AddPart(new EntityMovementModel { Speed = 400 })
},
{
DataType.TEAPOT_FlyingTeapot, new EntityModel(DataType.TEAPOT_FlyingTeapot, EntityType.Teapot)
.AddPart(new EntityInfoModel
{
Name = "Detector",
Description = "Has 1100 vision, and can see hidden units within 1000 range.",
Notes = @"Doesn't take up a scout slot."
})
.AddPart(new EntityRequirementModel { Id = DataType.TEAPOT_Teapot })
.AddPart(new EntitySupplyModel { Takes = 1 })
.AddPart(new EntityProductionModel { Alloy = 100, Ether = 50 })
.AddPart(new EntityVitalityModel { Health = 120, DefenseLayer = 80, Armor = ArmorType.Light })
.AddPart(new EntityMovementModel { Speed = 280, Movement = MovementType.Air })
.AddPart(new EntityIdPassiveModel { Id = DataType.PASSIVE_Detection })
},
// Families
{
DataType.FAMILY_Rae,
new EntityModel(DataType.FAMILY_Rae, EntityType.Family, true)
.AddPart(new EntityInfoModel
{
Name = "Rae"
})
},
{
DataType.FAMILY_Sylv,
new EntityModel(DataType.FAMILY_Sylv, EntityType.Family, true)
.AddPart(new EntityInfoModel
{
Name = "Sylv"
})
},
{
DataType.FAMILY_Angelic,
new EntityModel(DataType.FAMILY_Angelic, EntityType.Family, true)
.AddPart(new EntityInfoModel
{
Name = "Angelic"
})
},
{
DataType.FAMILY_Human,
new EntityModel(DataType.FAMILY_Human, EntityType.Family, true)
.AddPart(new EntityInfoModel
{
Name = "Human"
})
},
{
DataType.FAMILY_Coalition,
new EntityModel(DataType.FAMILY_Coalition, EntityType.Family, true)
.AddPart(new EntityInfoModel
{
Name = "Coalition?"
})
},
{
DataType.FAMILY_Demonic,
new EntityModel(DataType.FAMILY_Demonic, EntityType.Family, true)
.AddPart(new EntityInfoModel
{
Name = "Demonic?"
})
},
{
DataType.FAMILY_NazRa,
new EntityModel(DataType.FAMILY_NazRa, EntityType.Family, true)
.AddPart(new EntityInfoModel
{
Name = "Naz'Ra"
})
},
// Factions
// Sylv
{
DataType.FACTION_Aru,
new EntityModel(DataType.FACTION_Aru, EntityType.Faction)
.AddPart(new EntityInfoModel
{
Name = "Aru"
})
.AddPart(new EntityPassiveModel
{
Name = "Overgrowth",
Description =
"Your units have an extra layer of health a regens rapidly when a unit hasn't been damaged recently. This regen is doubled on rootway."
})
.AddPart(new EntityPassiveModel
{
Name = "Blood",
Description =
"Your casters passively get blood for spells. This blood regen rate is increased on rootway. Your casters can also spend their own life as blood. (Spending health as blood is currenly not in game.)"
})
.AddPart(new EntityPassiveModel
{
Name = "Blood Wells",
Description =
"You can summon blood wells for pyre, that allow you to heal your units health and mana."
})
},
{
DataType.FACTION_Iratek,
new EntityModel(DataType.FACTION_Iratek, EntityType.Faction, true)
.AddPart(new EntityInfoModel
{
Name = "Iratek"
})
},
{
DataType.FACTION_Yul,
new EntityModel(DataType.FACTION_Yul, EntityType.Faction, true)
.AddPart(new EntityInfoModel { Name = "Yul" })
},
// Factions
// Angelic
{
DataType.FACTION_QRath,
new EntityModel(DataType.FACTION_QRath, EntityType.Faction)
.AddPart(new EntityInfoModel
{
Name = "Q'Rath",
Notes =
"Angelic faction that has adopted many humans into their ranks. They seek to bring more into their collective."
})
.AddPart(new EntityPassiveModel
{
Name = "Wards",
Description =
"Your units have an extra layer of health that is always (but slowly) regenerates. The regeneration is double on Hallowed Ground."
})
},
{
DataType.FACTION_YRiah,
new EntityModel(DataType.FACTION_QRath, EntityType.Faction, true)
.AddPart(new EntityInfoModel { Name = "R'Raih" })
},
{
DataType.FACTION_ArkShai,
new EntityModel(DataType.FACTION_QRath, EntityType.Faction, true)
.AddPart(new EntityInfoModel
{ Name = "Ark'Shai" })
},
// Factions
// Human
{
DataType.FACTION_Jora,
new EntityModel(DataType.FACTION_Jora, EntityType.Faction, true)
.AddPart(new EntityInfoModel { Name = "Jora" })
},
{
DataType.FACTION_Telmetra,
new EntityModel(DataType.FACTION_Telmetra, EntityType.Faction, true)
.AddPart(new EntityInfoModel { Name = "Talmetra" })
},
{
DataType.FACTION_Kjor,
new EntityModel(DataType.FACTION_Kjor, EntityType.Faction, true)
.AddPart(new EntityInfoModel
{ Name = "Kjor" }
)
},
// Factions
// Rae
{
DataType.FACTION_Herlesh,
new EntityModel(DataType.FACTION_Herlesh, EntityType.Faction, true)
.AddPart(new EntityInfoModel { Name = "Herlesh" })
},
// Factions
// Coalition
{
DataType.FACTION_Khardu,
new EntityModel(DataType.FACTION_Khardu, EntityType.Faction, true)
.AddPart(new EntityInfoModel { Name = "Khardu" })
},
// Factions
// Neutral
{
DataType.FACTION_Neutral,
new EntityModel(DataType.FACTION_Neutral, EntityType.Faction)
.AddPart(new EntityInfoModel
{
Name = "Neutral"
})
},
// Keys
{
DataType.COMMAND_Attack,
new EntityModel(DataType.COMMAND_Attack, EntityType.Command)
.AddPart(new EntityInfoModel
{ Name = "Attack", Description = "Makes selected units attack targeted area." })
.AddPart(new EntityHotkeyModel { Hotkey = "A", HotkeyGroup = "D" })
},
{
DataType.COMMAND_StandGround,
new EntityModel(DataType.COMMAND_StandGround, EntityType.Command)
.AddPart(new EntityInfoModel
{ Name = "Stand Ground", Description = "Makes selected units stop moving." })
.AddPart(new EntityHotkeyModel { Hotkey = "S", HotkeyGroup = "D" })
},
// Starting Structures
{
DataType.STARTING_Bastion,
new EntityModel(DataType.STARTING_Bastion, EntityType.Building)
.AddPart(new EntityInfoModel
{
Name = "Bastion",
Description = "Provides a fully upgraded base worth of alloy.",
Notes = "Revives in 40 seconds when destroyed."
})
.AddPart(new EntityFactionModel { Faction = DataType.FACTION_Neutral })
.AddPart(new EntityHarvestModel
{
HarvestedPerInterval = 6, RequiresWorker = false, Resource = ResourceType.Alloy, Slots = 1,
TotalAmount = 6000
})
.AddPart(new EntityVitalityModel { Health = 500, Armor = ArmorType.Heavy })
.AddPart(new EntityWeaponModel
{ Damage = 30, AttacksPerSecond = 1.401f, Targets = TargetType.All, Range = 700 })
.AddPart(new EntityIdPassiveModel { Id = DataType.PASSIVE_BastionPassives })
},
{
DataType.STARTING_Tower,
new EntityModel(DataType.STARTING_Tower, EntityType.Building)
.AddPart(new EntityInfoModel
{
Name = "Starting Tower",
Notes = "Currently not in game. Can be upgraded to the factions pyre tower."
})
.AddPart(new EntityFactionModel { Faction = DataType.FACTION_Neutral })
.AddPart(new EntityFactionModel { Faction = DataType.FACTION_Neutral })
.AddPart(new EntityVitalityModel
{ Health = 1000, DefenseLayer = 500, Armor = ArmorType.Heavy, IsStructure = true })
.AddPart(new EntityWeaponModel
{
Damage = 20, Range = 800, AttacksPerSecond = 1.124f, Targets = TargetType.All,
MediumDamage = 25, HeavyDamage = 30
})
.AddPart(new EntityIdPassiveModel { Id = DataType.PASSIVE_Respite })
.AddPart(new EntityIdPassiveModel { Id = DataType.PASSIVE_HallowedGround })
},
// Starting Structures
// Aru
{
DataType.STARTING_TownHall_Aru,
new EntityModel(DataType.STARTING_TownHall_Aru, EntityType.Building, true)
.AddPart(new EntityInfoModel
{ Name = "Grove Heart (Starting)", Descriptive = DescriptiveType.TownHall_Starting })
.AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru })
.AddPart(new EntityVitalityModel
{ Health = 2000, DefenseLayer = 400, Armor = ArmorType.Heavy, IsStructure = true })
.AddPart(new EntityHarvestModel
{
HarvestedPerInterval = 1, RequiresWorker = true, Resource = ResourceType.Alloy, Slots = 6,
TotalAmount = 6000
})
.AddPart(new EntityIdPassiveModel { Id = DataType.PASSIVE_Rootway })
},
// Starting Structures
// Q'Rath
{
DataType.STARTING_TownHall_QRath,
new EntityModel(DataType.STARTING_TownHall_QRath, EntityType.Building, true)
.AddPart(new EntityInfoModel
{ Name = "Acropolis (Starting)", Descriptive = DescriptiveType.TownHall_Starting })
.AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath })
.AddPart(new EntityVitalityModel
{ Health = 1600, DefenseLayer = 800, Armor = ArmorType.Heavy, IsStructure = true })
.AddPart(new EntityHarvestModel
{
HarvestedPerInterval = 6, RequiresWorker = false, Resource = ResourceType.Alloy, Slots = 1,
TotalAmount = 6000
})
.AddPart(new EntityIdPassiveModel { Id = DataType.PASSIVE_HallowedGround })
},
// Passives
// Neutral
{
DataType.PASSIVE_Detection,
new EntityModel(DataType.PASSIVE_Detection, EntityType.Passive)
.AddPart(new EntityInfoModel
{
Name = "Detection", Descriptive = DescriptiveType.Passive,
Description =
@"Unit can see all hidden units in its detection radius."
})
.AddPart(new EntityFactionModel { Faction = DataType.Any })
},
{
DataType.PASSIVE_BastionPassives,
new EntityModel(DataType.PASSIVE_BastionPassives, EntityType.Passive)
.AddPart(new EntityInfoModel
{
Name = "(Scouts and Pyre)", Descriptive = DescriptiveType.Passive,
Description =
@"Bastion generates one scout in 2 minutes, up to a max of 2 scouts. And generates pyre over time."
})
.AddPart(new EntityFactionModel { Faction = DataType.Any })
},
{
DataType.PASSIVE_Respite,
new EntityModel(DataType.PASSIVE_Respite, EntityType.Passive)
.AddPart(new EntityInfoModel
{
Name = "Respite", Descriptive = DescriptiveType.Passive,
Description =
@"Nearby units will slowly heal after not attacking or being attacked for 10 seconds."
})
.AddPart(new EntityFactionModel { Faction = DataType.Any })
},
{
DataType.PASSIVE_HarvestAlloy,
new EntityModel(DataType.PASSIVE_HarvestAlloy, EntityType.Passive)
.AddPart(new EntityInfoModel
{
Name = "Harvest Alloy", Descriptive = DescriptiveType.Passive,
Description = "This unit can harvest alloy."
})
.AddPart(new EntityFactionModel { Faction = DataType.Any })
},
{
DataType.NEUTRAL_PyreMiner,
new EntityModel(DataType.NEUTRAL_PyreMiner, EntityType.Building)
.AddPart(new EntityInfoModel
{
Name = "Pyre Miner",
Description = "Passively harvest pyre.",
Notes = ""
})
}
};
}
}

385
Model/Entity/Data/EntityData.cs

@ -1,8 +1,5 @@
using System.Collections.Generic;
using System.Linq;
using Model.Entity.Parts;
using Model.Entity.Types;
using Model.Types;
using Newtonsoft.Json;
namespace Model.Entity.Data;
@ -17,389 +14,13 @@ public partial class EntityData
public static Dictionary<string, EntityModel> Get()
{
var entityModels = new Dictionary<string, EntityModel>
{
// Neutrals
// Pyre Events
{
DataType.PYREEVENT_CampTaken, new EntityModel(DataType.PYREEVENT_CampTaken, EntityType.Pyre_Event)
.AddPart(new EntityInfoModel { Name = "Pyre Camp", Description = "Provides 25 when taken." })
.AddPart(new EntityPyreRewardModel { BaseReward = 25 })
.AddPart(new EntityHotkeyModel { Hotkey = "E", HotkeyGroup = "2" })
},
{
DataType.PYREEVENT_MinerTaken, new EntityModel(DataType.PYREEVENT_MinerTaken, EntityType.Pyre_Event)
.AddPart(new EntityInfoModel { Name = "Pyre Camp", Description = "Provides 90 when taken." })
.AddPart(new EntityPyreRewardModel
{ BaseReward = 0, OverTimeRewardDuration = 90, OverTimeReward = 1 })
.AddPart(new EntityHotkeyModel { Hotkey = "Q", HotkeyGroup = "2" })
},
{
DataType.PYREEVENT_TowerKilled, new EntityModel(DataType.PYREEVENT_TowerKilled, EntityType.Pyre_Event)
.AddPart(new EntityInfoModel { Name = "Tower Taken", Description = "Provides 10 when destroyed." })
.AddPart(new EntityPyreRewardModel { BaseReward = 10 })
.AddPart(new EntityHotkeyModel { Hotkey = "R", HotkeyGroup = "2" })
},
// TEAPOTS
{
DataType.TEAPOT_Teapot, new EntityModel(DataType.TEAPOT_Teapot, EntityType.Teapot)
.AddPart(new EntityInfoModel
{
Name = "Teapot", Description = "Basic scout. Every faction has this",
Notes = @"Very powerful! So Fast"
})
.AddPart(new EntityVitalityModel { Health = 120, Armor = ArmorType.Light })
.AddPart(new EntityMovementModel { Speed = 400 })
},
{
DataType.TEAPOT_FlyingTeapot, new EntityModel(DataType.TEAPOT_FlyingTeapot, EntityType.Teapot)
.AddPart(new EntityInfoModel
{
Name = "Detector",
Description = "Has 1100 vision, and can see hidden units within 1000 range.",
Notes = @"Doesn't take up a scout slot."
})
.AddPart(new EntityRequirementModel { Id = DataType.TEAPOT_Teapot })
.AddPart(new EntitySupplyModel { Takes = 1 })
.AddPart(new EntityProductionModel { Alloy = 100, Ether = 50 })
.AddPart(new EntityVitalityModel { Health = 120, DefenseLayer = 80, Armor = ArmorType.Light })
.AddPart(new EntityMovementModel { Speed = 280, Movement = MovementType.Air })
.AddPart(new EntityIdPassiveModel { Id = DataType.PASSIVE_Detection })
},
// Families
{
DataType.FAMILY_Rae,
new EntityModel(DataType.FAMILY_Rae, EntityType.Family, true)
.AddPart(new EntityInfoModel
{
Name = "Rae"
})
},
{
DataType.FAMILY_Sylv,
new EntityModel(DataType.FAMILY_Sylv, EntityType.Family, true)
.AddPart(new EntityInfoModel
{
Name = "Sylv"
})
},
{
DataType.FAMILY_Angelic,
new EntityModel(DataType.FAMILY_Angelic, EntityType.Family, true)
.AddPart(new EntityInfoModel
{
Name = "Angelic"
})
},
{
DataType.FAMILY_Human,
new EntityModel(DataType.FAMILY_Human, EntityType.Family, true)
.AddPart(new EntityInfoModel
{
Name = "Human"
})
},
{
DataType.FAMILY_Coalition,
new EntityModel(DataType.FAMILY_Coalition, EntityType.Family, true)
.AddPart(new EntityInfoModel
{
Name = "Coalition?"
})
},
{
DataType.FAMILY_Demonic,
new EntityModel(DataType.FAMILY_Demonic, EntityType.Family, true)
.AddPart(new EntityInfoModel
{
Name = "Demonic?"
})
},
{
DataType.FAMILY_NazRa,
new EntityModel(DataType.FAMILY_NazRa, EntityType.Family, true)
.AddPart(new EntityInfoModel
{
Name = "Naz'Ra"
})
},
// Factions
// Sylv
{
DataType.FACTION_Aru,
new EntityModel(DataType.FACTION_Aru, EntityType.Faction)
.AddPart(new EntityInfoModel
{
Name = "Aru"
})
.AddPart(new EntityPassiveModel
{
Name = "Overgrowth",
Description =
"Your units have an extra layer of health a regens rapidly when a unit hasn't been damaged recently. This regen is doubled on rootway."
})
.AddPart(new EntityPassiveModel
{
Name = "Blood",
Description =
"Your casters passively get blood for spells. This blood regen rate is increased on rootway. Your casters can also spend their own life as blood. (Spending health as blood is currenly not in game.)"
})
.AddPart(new EntityPassiveModel
{
Name = "Blood Wells",
Description =
"You can summon blood wells for pyre, that allow you to heal your units health and mana."
})
},
{
DataType.FACTION_Iratek,
new EntityModel(DataType.FACTION_Iratek, EntityType.Faction, true)
.AddPart(new EntityInfoModel
{
Name = "Iratek"
})
},
{
DataType.FACTION_Yul,
new EntityModel(DataType.FACTION_Yul, EntityType.Faction, true)
.AddPart(new EntityInfoModel { Name = "Yul" })
},
// Factions
// Angelic
{
DataType.FACTION_QRath,
new EntityModel(DataType.FACTION_QRath, EntityType.Faction)
.AddPart(new EntityInfoModel
{
Name = "Q'Rath",
Notes =
"Angelic faction that has adopted many humans into their ranks. They seek to bring more into their collective."
})
.AddPart(new EntityPassiveModel
{
Name = "Wards",
Description =
"Your units have an extra layer of health that is always (but slowly) regenerates. The regeneration is double on Hallowed Ground."
})
},
{
DataType.FACTION_YRiah,
new EntityModel(DataType.FACTION_QRath, EntityType.Faction, true)
.AddPart(new EntityInfoModel { Name = "R'Raih" })
},
{
DataType.FACTION_ArkShai,
new EntityModel(DataType.FACTION_QRath, EntityType.Faction, true)
.AddPart(new EntityInfoModel
{ Name = "Ark'Shai" })
},
// Factions
// Human
{
DataType.FACTION_Jora,
new EntityModel(DataType.FACTION_Jora, EntityType.Faction, true)
.AddPart(new EntityInfoModel { Name = "Jora" })
},
{
DataType.FACTION_Telmetra,
new EntityModel(DataType.FACTION_Telmetra, EntityType.Faction, true)
.AddPart(new EntityInfoModel { Name = "Talmetra" })
},
{
DataType.FACTION_Kjor,
new EntityModel(DataType.FACTION_Kjor, EntityType.Faction, true)
.AddPart(new EntityInfoModel
{ Name = "Kjor" }
)
},
// Factions
// Rae
{
DataType.FACTION_Herlesh,
new EntityModel(DataType.FACTION_Herlesh, EntityType.Faction, true)
.AddPart(new EntityInfoModel { Name = "Herlesh" })
},
// Factions
// Coalition
{
DataType.FACTION_Khardu,
new EntityModel(DataType.FACTION_Khardu, EntityType.Faction, true)
.AddPart(new EntityInfoModel { Name = "Khardu" })
},
// Factions
// Neutral
{
DataType.FACTION_Neutral,
new EntityModel(DataType.FACTION_Neutral, EntityType.Faction)
.AddPart(new EntityInfoModel
{
Name = "Neutral"
})
},
// Keys
{
DataType.COMMAND_Attack,
new EntityModel(DataType.COMMAND_Attack, EntityType.Command)
.AddPart(new EntityInfoModel
{ Name = "Attack", Description = "Makes selected units attack targeted area." })
.AddPart(new EntityHotkeyModel { Hotkey = "A", HotkeyGroup = "D" })
},
{
DataType.COMMAND_StandGround,
new EntityModel(DataType.COMMAND_StandGround, EntityType.Command)
.AddPart(new EntityInfoModel
{ Name = "Stand Ground", Description = "Makes selected units stop moving." })
.AddPart(new EntityHotkeyModel { Hotkey = "S", HotkeyGroup = "D" })
},
// Starting Structures
{
DataType.STARTING_Bastion,
new EntityModel(DataType.STARTING_Bastion, EntityType.Building)
.AddPart(new EntityInfoModel
{
Name = "Bastion",
Description = "Provides a fully upgraded base worth of alloy.",
Notes = "Revives in 40 seconds when destroyed."
})
.AddPart(new EntityFactionModel { Faction = DataType.FACTION_Neutral })
.AddPart(new EntityHarvestModel
{
HarvestedPerInterval = 6, RequiresWorker = false, Resource = ResourceType.Alloy, Slots = 1,
TotalAmount = 6000
})
.AddPart(new EntityVitalityModel { Health = 500, Armor = ArmorType.Heavy })
.AddPart(new EntityWeaponModel
{ Damage = 30, AttacksPerSecond = 1.401f, Targets = TargetType.All, Range = 700 })
.AddPart(new EntityIdPassiveModel { Id = DataType.PASSIVE_BastionPassives })
},
{
DataType.STARTING_Tower,
new EntityModel(DataType.STARTING_Tower, EntityType.Building)
.AddPart(new EntityInfoModel
{
Name = "Starting Tower",
Notes = "Currently not in game. Can be upgraded to the factions pyre tower."
})
.AddPart(new EntityFactionModel { Faction = DataType.FACTION_Neutral })
.AddPart(new EntityFactionModel { Faction = DataType.FACTION_Neutral })
.AddPart(new EntityVitalityModel
{ Health = 1000, DefenseLayer = 500, Armor = ArmorType.Heavy, IsStructure = true })
.AddPart(new EntityWeaponModel
{
Damage = 20, Range = 800, AttacksPerSecond = 1.124f, Targets = TargetType.All,
MediumDamage = 25, HeavyDamage = 30
})
.AddPart(new EntityIdPassiveModel { Id = DataType.PASSIVE_Respite })
.AddPart(new EntityIdPassiveModel { Id = DataType.PASSIVE_HallowedGround })
},
// Starting Structures
// Aru
{
DataType.STARTING_TownHall_Aru,
new EntityModel(DataType.STARTING_TownHall_Aru, EntityType.Building, true)
.AddPart(new EntityInfoModel
{ Name = "Grove Heart (Starting)", Descriptive = DescriptiveType.TownHall_Starting })
.AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru })
.AddPart(new EntityVitalityModel
{ Health = 2000, DefenseLayer = 400, Armor = ArmorType.Heavy, IsStructure = true })
.AddPart(new EntityHarvestModel
{
HarvestedPerInterval = 1, RequiresWorker = true, Resource = ResourceType.Alloy, Slots = 6,
TotalAmount = 6000
})
.AddPart(new EntityIdPassiveModel { Id = DataType.PASSIVE_Rootway })
},
// Starting Structures
// Q'Rath
{
DataType.STARTING_TownHall_QRath,
new EntityModel(DataType.STARTING_TownHall_QRath, EntityType.Building, true)
.AddPart(new EntityInfoModel
{ Name = "Acropolis (Starting)", Descriptive = DescriptiveType.TownHall_Starting })
.AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath })
.AddPart(new EntityVitalityModel
{ Health = 1600, DefenseLayer = 800, Armor = ArmorType.Heavy, IsStructure = true })
.AddPart(new EntityHarvestModel
{
HarvestedPerInterval = 6, RequiresWorker = false, Resource = ResourceType.Alloy, Slots = 1,
TotalAmount = 6000
})
.AddPart(new EntityIdPassiveModel { Id = DataType.PASSIVE_HallowedGround })
},
// Passives
// Neutral
{
DataType.PASSIVE_Detection,
new EntityModel(DataType.PASSIVE_Detection, EntityType.Passive)
.AddPart(new EntityInfoModel
{
Name = "Detection", Descriptive = DescriptiveType.Passive,
Description =
@"Unit can see all hidden units in its detection radius."
})
.AddPart(new EntityFactionModel { Faction = DataType.Any })
},
{
DataType.PASSIVE_BastionPassives,
new EntityModel(DataType.PASSIVE_BastionPassives, EntityType.Passive)
.AddPart(new EntityInfoModel
{
Name = "(Scouts and Pyre)", Descriptive = DescriptiveType.Passive,
Description =
@"Bastion generates one scout in 2 minutes, up to a max of 2 scouts. And generates pyre over time."
})
.AddPart(new EntityFactionModel { Faction = DataType.Any })
},
{
DataType.PASSIVE_Respite,
new EntityModel(DataType.PASSIVE_Respite, EntityType.Passive)
.AddPart(new EntityInfoModel
{
Name = "Respite", Descriptive = DescriptiveType.Passive,
Description =
@"Nearby units will slowly heal after not attacking or being attacked for 10 seconds."
})
.AddPart(new EntityFactionModel { Faction = DataType.Any })
},
{
DataType.PASSIVE_HarvestAlloy,
new EntityModel(DataType.PASSIVE_HarvestAlloy, EntityType.Passive)
.AddPart(new EntityInfoModel
{
Name = "Harvest Alloy", Descriptive = DescriptiveType.Passive,
Description = "This unit can harvest alloy."
})
.AddPart(new EntityFactionModel { Faction = DataType.Any })
},
{
DataType.NEUTRAL_PyreMiner,
new EntityModel(DataType.NEUTRAL_PyreMiner, EntityType.Building)
.AddPart(new EntityInfoModel
{
Name = "Pyre Miner",
Description = "Passively harvest pyre.",
Notes = ""
})
}
};
return entityModels
.Concat(GetResearchData())
return GetResearchData()
.Concat(GetArmyData())
.Concat(GetAbilityData())
.Concat(GetMiscData())
.Concat(GetImmortalData())
.Concat(GetBuildingData())
.Concat(GetPassiveData())
.ToDictionary(
a => a.Key,
a => a.Value);
.ToDictionary();
}
}

53
Model/Website/Data/EntityData.cs

@ -0,0 +1,53 @@
using System.Collections.Generic;
namespace Model.Website.Data;
public class WebsiteData
{
public static List<WebPageModel> GetPages()
{
return
[
new WebPageModel
{
Id = 2,
WebSectionModelId = 2,
Name = "Build Calculator",
Description = "Build order calculator for determining army timings",
Href = "build-calculator",
IsPrivate = "False",
Icon = "fa-solid fa-helmet-battle"
},
new WebPageModel
{
Id = 1,
WebSectionModelId = 2,
Name = "Database",
Description = "Database of game information",
Href = "database",
IsPrivate = "False",
Icon = "fa-solid fa-clipboard-list"
},
new WebPageModel
{
Id = 3,
WebSectionModelId = 2,
Name = "Harass Calculator",
Description = "Database of game information",
Href = "database",
IsPrivate = "False",
Icon = "fa-solid fa-bow-arrow"
},
new WebPageModel
{
Id = 4,
WebSectionModelId = 2,
Name = "Data Tables",
Description = "Data tables",
Href = "data-tables",
IsPrivate = "False",
Icon = "fa-solid fa-table-list"
}
];
}
}

7
Model/Website/WebPageModel.cs

@ -2,10 +2,11 @@
public class WebPageModel
{
public int Id { get; set; }
public int? WebSectionModelId { get; set; }
public int Id { get; set; } // Not used
public int? WebSectionModelId { get; set; } // Not used
public string Name { get; set; } = "Add name";
public string Description { get; set; } = "Add description";
public string Href { get; set; } = null;
public string IsPrivate { get; set; } = "True";
public string IsPrivate { get; set; } = "True"; // Not used. Make boolean
public string Icon { get; set; }
}

1
Services/Website/WebsiteService.cs

@ -55,7 +55,6 @@ public class WebsiteService : IWebsiteService
NotifyDataChanged();
}
private event Action OnChange = default!;
private void SortSql()

Loading…
Cancel
Save