Clean up code formatting and enhance data immutability
Standardized spacing and removed extraneous white space across multiple files for better readability. Updated several data grids to use `readonly` for `_data` collections, improving immutability and code clarity.
This commit is contained in:
@@ -48,7 +48,7 @@
|
|||||||
<MudIcon Icon="fa-solid fa-clipboard-list" Class="mr-2"/>
|
<MudIcon Icon="fa-solid fa-clipboard-list" Class="mr-2"/>
|
||||||
Database
|
Database
|
||||||
</MudButton>
|
</MudButton>
|
||||||
|
|
||||||
<MudButton Href="/data-tables"
|
<MudButton Href="/data-tables"
|
||||||
Variant="Variant.Text"
|
Variant="Variant.Text"
|
||||||
Color="Color.Default"
|
Color="Color.Default"
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<LayoutLargeContentComponent>
|
<LayoutLargeContentComponent>
|
||||||
<WebsiteTitleComponent>Data Tables</WebsiteTitleComponent>
|
<WebsiteTitleComponent>Data Tables</WebsiteTitleComponent>
|
||||||
<MudTabs Elevation="2" >
|
<MudTabs Elevation="2">
|
||||||
<MudTabPanel Text="Attacks">
|
<MudTabPanel Text="Attacks">
|
||||||
<WeaponTable/>
|
<WeaponTable/>
|
||||||
</MudTabPanel>
|
</MudTabPanel>
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
<MovementTable/>
|
<MovementTable/>
|
||||||
</MudTabPanel>
|
</MudTabPanel>
|
||||||
</MudTabs>
|
</MudTabs>
|
||||||
|
|
||||||
|
|
||||||
<ContentDividerComponent></ContentDividerComponent>
|
<ContentDividerComponent></ContentDividerComponent>
|
||||||
|
|
||||||
@@ -30,7 +30,9 @@
|
|||||||
What is this tool?
|
What is this tool?
|
||||||
</InfoQuestionComponent>
|
</InfoQuestionComponent>
|
||||||
<InfoAnswerComponent>
|
<InfoAnswerComponent>
|
||||||
This tool is a data table of all information belonging to a type of data. Such as viewing all weapons, so one can easily sort and see what weapon attack has the highest range, and what faction and unit that attack belongs to.
|
This tool is a data table of all information belonging to a type of data. Such as viewing all weapons,
|
||||||
|
so one can easily sort and see what weapon attack has the highest range, and what faction and unit that
|
||||||
|
attack belongs to.
|
||||||
</InfoAnswerComponent>
|
</InfoAnswerComponent>
|
||||||
</InfoBodyComponent>
|
</InfoBodyComponent>
|
||||||
|
|
||||||
|
|||||||
@@ -1,19 +1,21 @@
|
|||||||
<MudDataGrid T="EntityMovementModel" Items="@_data"
|
<MudDataGrid T="EntityMovementModel" Items="@_data"
|
||||||
SortMode="SortMode.Multiple"
|
SortMode="SortMode.Multiple"
|
||||||
Filterable="true"
|
Filterable="true"
|
||||||
Hideable="true">
|
Hideable="true">
|
||||||
<Columns>
|
<Columns>
|
||||||
<PropertyColumn Property="x => x.Parent.GetName()" Title="Entity"/>
|
<PropertyColumn Property="x => x.Parent.GetName()" Title="Entity"/>
|
||||||
<PropertyColumn Property="x => x.Movement"/>
|
<PropertyColumn Property="x => x.Movement"/>
|
||||||
<PropertyColumn Property="x => x.Speed" />
|
<PropertyColumn Property="x => x.Speed"/>
|
||||||
<PropertyColumn Property="x => x.Parent.GetFaction()" Title="Faction"/>
|
<PropertyColumn Property="x => x.Parent.GetFaction()" Title="Faction"/>
|
||||||
<PropertyColumn Property="x => x.Parent.GetImmortal()" Title="Immortal"/>
|
<PropertyColumn Property="x => x.Parent.GetImmortal()" Title="Immortal"/>
|
||||||
</Columns>
|
</Columns>
|
||||||
</MudDataGrid>
|
</MudDataGrid>
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
IEnumerable<EntityMovementModel> _data = DATA.Get()
|
|
||||||
|
readonly IEnumerable<EntityMovementModel> _data = DATA.Get()
|
||||||
.SelectMany(e => e.Value.EntityParts)
|
.SelectMany(e => e.Value.EntityParts)
|
||||||
.OfType<EntityMovementModel>()
|
.OfType<EntityMovementModel>()
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<MudDataGrid T="EntityProductionModel" Items="@data"
|
<MudDataGrid T="EntityProductionModel" Items="@data"
|
||||||
SortMode="SortMode.Multiple"
|
SortMode="SortMode.Multiple"
|
||||||
Filterable="true"
|
Filterable="true"
|
||||||
Hideable="true">
|
Hideable="true">
|
||||||
<Columns>
|
<Columns>
|
||||||
@@ -18,4 +18,5 @@
|
|||||||
.SelectMany(e => e.Value.EntityParts)
|
.SelectMany(e => e.Value.EntityParts)
|
||||||
.OfType<EntityProductionModel>()
|
.OfType<EntityProductionModel>()
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,23 +1,25 @@
|
|||||||
<MudDataGrid T="EntityVitalityModel" Items="@_data"
|
<MudDataGrid T="EntityVitalityModel" Items="@_data"
|
||||||
SortMode="SortMode.Multiple"
|
SortMode="SortMode.Multiple"
|
||||||
Filterable="true"
|
Filterable="true"
|
||||||
Hideable="true">
|
Hideable="true">
|
||||||
<Columns>
|
<Columns>
|
||||||
<PropertyColumn Property="x => x.Parent.GetName()" Title="Entity"/>
|
<PropertyColumn Property="x => x.Parent.GetName()" Title="Entity"/>
|
||||||
<PropertyColumn Property="x => x.Health"/>
|
<PropertyColumn Property="x => x.Health"/>
|
||||||
<PropertyColumn Property="x => x.Armor" />
|
<PropertyColumn Property="x => x.Armor"/>
|
||||||
<PropertyColumn Property="x => x.Defense" />
|
<PropertyColumn Property="x => x.Defense"/>
|
||||||
<PropertyColumn Property="x => x.DefenseLayer" />
|
<PropertyColumn Property="x => x.DefenseLayer"/>
|
||||||
<PropertyColumn Property="x => x.IsStructure" />
|
<PropertyColumn Property="x => x.IsStructure"/>
|
||||||
<PropertyColumn Property="x => x.IsEtheric" />
|
<PropertyColumn Property="x => x.IsEtheric"/>
|
||||||
<PropertyColumn Property="x => x.Parent.GetFaction()" Title="Faction"/>
|
<PropertyColumn Property="x => x.Parent.GetFaction()" Title="Faction"/>
|
||||||
<PropertyColumn Property="x => x.Parent.GetImmortal()" Title="Immortal"/>
|
<PropertyColumn Property="x => x.Parent.GetImmortal()" Title="Immortal"/>
|
||||||
</Columns>
|
</Columns>
|
||||||
</MudDataGrid>
|
</MudDataGrid>
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
IEnumerable<EntityVitalityModel> _data = DATA.Get()
|
|
||||||
|
readonly IEnumerable<EntityVitalityModel> _data = DATA.Get()
|
||||||
.SelectMany(e => e.Value.EntityParts)
|
.SelectMany(e => e.Value.EntityParts)
|
||||||
.OfType<EntityVitalityModel>()
|
.OfType<EntityVitalityModel>()
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<MudDataGrid T="EntityWeaponModel" Items="@_data"
|
<MudDataGrid T="EntityWeaponModel" Items="@_data"
|
||||||
SortMode="SortMode.Multiple"
|
SortMode="SortMode.Multiple"
|
||||||
Filterable="true"
|
Filterable="true"
|
||||||
Hideable="true">
|
Hideable="true">
|
||||||
<Columns>
|
<Columns>
|
||||||
@@ -17,13 +17,15 @@
|
|||||||
<PropertyColumn Property="x => x.Parent.GetImmortal()" Title="Immortal"/>
|
<PropertyColumn Property="x => x.Parent.GetImmortal()" Title="Immortal"/>
|
||||||
</Columns>
|
</Columns>
|
||||||
<PagerContent>
|
<PagerContent>
|
||||||
<MudDataGridPager T="EntityWeaponModel" />
|
<MudDataGridPager T="EntityWeaponModel"/>
|
||||||
</PagerContent>
|
</PagerContent>
|
||||||
</MudDataGrid>
|
</MudDataGrid>
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
IEnumerable<EntityWeaponModel> _data = DATA.Get()
|
|
||||||
|
readonly IEnumerable<EntityWeaponModel> _data = DATA.Get()
|
||||||
.SelectMany(e => e.Value.EntityParts)
|
.SelectMany(e => e.Value.EntityParts)
|
||||||
.OfType<EntityWeaponModel>()
|
.OfType<EntityWeaponModel>()
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
@layout PageLayout
|
@layout PageLayout
|
||||||
@inherits BasePage
|
@inherits BasePage
|
||||||
@page "/database"
|
@page "/database"
|
||||||
|
|
||||||
@using Model
|
@using Model
|
||||||
@implements IDisposable
|
@implements IDisposable
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,6 @@
|
|||||||
@page "/database/{text}"
|
@page "/database/{text}"
|
||||||
|
|
||||||
@inject IEntityDisplayService EntityDisplayService
|
@inject IEntityDisplayService EntityDisplayService
|
||||||
|
|
||||||
@using Model
|
@using Model
|
||||||
@implements IDisposable
|
@implements IDisposable
|
||||||
|
|
||||||
|
|||||||
@@ -80,7 +80,6 @@ builder.Services.AddScoped(sp => new HttpClient
|
|||||||
builder.Services.AddMudServices();
|
builder.Services.AddMudServices();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
await builder.Build().RunAsync();
|
await builder.Build().RunAsync();
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user