Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Commit

Permalink
Merge pull request #183 from mxashlynn/rewrites-region-classes
Browse files Browse the repository at this point in the history
Adds commits missing from prior merge.
  • Loading branch information
mxashlynn authored Feb 26, 2021
2 parents 3ee664c + 32ac983 commit 1cc02b4
Show file tree
Hide file tree
Showing 79 changed files with 1,443 additions and 1,093 deletions.
7 changes: 4 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -183,16 +183,17 @@ dotnet_naming_style.begins_with_i.capitalization = pascal_case
dotnet_code_quality.api_surface = all

# Parquet-Specific Type Suffixes
dotnet_code_quality.CA1710.additional_required_suffixes = T:System.Collections.Generic.ICollection<T>->Collection|Grid|Inventory
dotnet_code_quality.CA1710.additional_required_suffixes = T:System.Collections.Generic.IEnumerable<T>->Collection|Grid|Inventory
dotnet_code_quality.CA1710.additional_required_suffixes = T:System.Collections.Generic.IReadOnlyCollection<T>->Collection|Grid|Inventory
dotnet_code_quality.CA1710.additional_required_suffixes = T:System.Collections.Generic.ICollection<T>->Collection|Grid
dotnet_code_quality.CA1710.additional_required_suffixes = T:System.Collections.Generic.IEnumerable<T>->Collection|Grid
dotnet_code_quality.CA1710.additional_required_suffixes = T:System.Collections.Generic.IReadOnlyCollection<T>->Collection|Grid
dotnet_code_quality.CA1710.additional_required_suffixes = T:System.Collections.Generic.IReadOnlySet<T>->Collection|Set
dotnet_code_quality.CA1710.additional_required_suffixes = T:System.Collections.Generic.ISet<T>->Collection|Set
dotnet_code_quality.CA1710.additional_required_suffixes = T:ParquetClassLibrary.IGrid<T>->Grid
dotnet_code_quality.CA1710.additional_required_suffixes = T:ParquetClassLibrary.IReadOnlyGrid<T>->Grid
dotnet_code_quality.CA1710.additional_required_suffixes = T:ParquetClassLibrary.Model->Model|Recipe
dotnet_code_quality.CA1710.additional_required_suffixes = T:ParquetClassLibrary.ModelCollection->Collection
dotnet_code_quality.CA1710.additional_required_suffixes = T:ParquetClassLibrary.ModelID->ID
dotnet_code_quality.CA1710.additional_required_suffixes = T:ParquetClassLibrary.Status<T>->Status

# Symbols
dotnet_naming_symbols.interface.applicable_kinds = interface
Expand Down
28 changes: 24 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,27 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning 2.0.0](https://semver.org/).


## [0.4.0] - 2021-02-23
### Pre-Alpha 3 API Revision
- This update changes the API in far-reaching ways in order to separate design-time and play-time concerns in map-related types.
#### Adds
- Adds Status type as a base class for all mutable-at-play types, analogous to Models.
- Derives a Status-based partner class for most Model classes.
- Adds Pack container type as base for ParquetModelPack and ParquetStatusPack.
- Adds LibraryState static class to track build and run characteristics, particularly Debug-vs-Release and Play-vs-Edit.
#### Removes
- MapModel abstract class, as there is only one map-related Model in the new hierarchy.
#### Changes
- Merges the definitional elements (procedural generation instructions and metadata) of MapRegion and MapSketch into single RegionModel.
- Merges the mutable elements (parquets and their statuses) of MapRegion and MapSketch into a single RegionStatus class.
- Changes MapChunk to a stand-alone class rather than a Model subtype.
- Renames namespace from Map to Region.
- Alters the BeingModel class family to better interoperate with the new RegionModel class family.
- Changes the name of Inventory class to InventoryCollection to avoid confusion in the BeingStatus classes.
- Updates the serialized example data for RegionModel and BeingModel class families.
- Reimplements cloning to enforce deep copying.
- Many minor fixes and corrections along the way.

## [0.3.56] - 2021-02-12
#### Adds
- General purpose Tags collection to the base Model type.
Expand All @@ -19,15 +40,14 @@ and this project adheres to [Semantic Versioning 2.0.0](https://semver.org/).
### Pre-Alpha 2 Milestone
#### Added
- Major mechanical systems.
#### Changed
- Replaced "IsHandmade" flag with "IsFilledOut" flag.
- Many small changes to support Scrube GUI editor.
#### Changes
- Many small changes to support Scribe GUI editor.

## [0.2.0] - 2020-04-18
### Pre-Alpha 1 Milestone
#### Added
- Models for all major game systems.
- Roller command line untility.
- Roller command line utility.

## [0.1.0] - 2019-01-28
#### Added
Expand Down
9 changes: 4 additions & 5 deletions ParquetClassLibrary/All.cs
Original file line number Diff line number Diff line change
Expand Up @@ -440,15 +440,15 @@ static All()
{ typeof(RecipeElement), RecipeElement.ConverterFactory },
{ typeof(ScriptNode), ScriptNode.ConverterFactory },
{ typeof(StrikePanel), StrikePanel.ConverterFactory },
{ typeof(Vector2D), Vector2D.ConverterFactory },
{ typeof(Point2D), Point2D.ConverterFactory },
#endregion

#region Linear Series Types
{ typeof(IEnumerable<ModelID>), SeriesConverter<ModelID, List<ModelID>>.ConverterFactory },
{ typeof(IEnumerable<ModelTag>), SeriesConverter<ModelTag, List<ModelTag>>.ConverterFactory },
{ typeof(IEnumerable<RecipeElement>), SeriesConverter<RecipeElement, List<RecipeElement>>.ConverterFactory },
{ typeof(IEnumerable<ScriptNode>), SeriesConverter<ScriptNode, List<ScriptNode>>.ConverterFactory },
{ typeof(Inventory), SeriesConverter<InventorySlot, Inventory>.ConverterFactory },
{ typeof(InventoryCollection), SeriesConverter<InventorySlot, InventoryCollection>.ConverterFactory },
{ typeof(IReadOnlyList<ModelID>), SeriesConverter<ModelID, List<ModelID>>.ConverterFactory },
{ typeof(IReadOnlyList<ModelTag>), SeriesConverter<ModelTag, List<ModelTag>>.ConverterFactory },
{ typeof(IReadOnlyList<RecipeElement>), SeriesConverter<RecipeElement, List<RecipeElement>>.ConverterFactory },
Expand Down Expand Up @@ -574,6 +574,7 @@ public static bool LoadFromCSVs()
#endregion

#region Read Models
// TODO: [MAP] [SERIALIZATION] Serialization data for Regions and Beings needs to be updated
var games = ModelCollection<GameModel>.ConverterFactory.GetRecordsForType<GameModel>(GameIDs);
var floors = ModelCollection<FloorModel>.ConverterFactory.GetRecordsForType<FloorModel>(ParquetIDs);
var blocks = ModelCollection<BlockModel>.ConverterFactory.GetRecordsForType<BlockModel>(ParquetIDs);
Expand All @@ -584,9 +585,7 @@ public static bool LoadFromCSVs()
var biomeRecipes = ModelCollection<BiomeRecipe>.ConverterFactory.GetRecordsForType<BiomeRecipe>(BiomeRecipeIDs);
var craftingRecipes = ModelCollection<CraftingRecipe>.ConverterFactory.GetRecordsForType<CraftingRecipe>(CraftingRecipeIDs);
var roomRecipes = ModelCollection<RoomRecipe>.ConverterFactory.GetRecordsForType<RoomRecipe>(RoomRecipeIDs);
var regions = ModelCollection<RegionModel>.Default;
// TODO: [MAP] [SERIALIZATION] Reenable these after refactor.
// ModelCollection<RegionModel>.ConverterFactory.GetRecordsForType<MapRegionModel>(MapIDs);
var regions = ModelCollection<RegionModel>.ConverterFactory.GetRecordsForType<RegionModel>(RegionIDs);
var scripts = ModelCollection<ScriptModel>.ConverterFactory.GetRecordsForType<ScriptModel>(ScriptIDs);
var interactions = ModelCollection<InteractionModel>.ConverterFactory.GetRecordsForType<InteractionModel>(InteractionIDs);
var items = ModelCollection<ItemModel>.ConverterFactory.GetRecordsForType<ItemModel>(ItemIDs);
Expand Down
7 changes: 2 additions & 5 deletions ParquetClassLibrary/Beings/BeingModel.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using CsvHelper.Configuration.Attributes;
using Parquet.Scripts;
Expand All @@ -10,18 +9,16 @@ namespace Parquet.Beings
/// <summary>
/// Models the basic definitions shared by any in-game actor.
/// </summary>
[SuppressMessage("Design", "CA1033:Interface methods should be callable by subtypes",
Justification = "By design, subtypes of Model should never themselves use IMutableModel or derived interfaces to access their own members. The IMutableModel family of interfaces is for external types that require read/write access.")]
public abstract class BeingModel : Model, IMutableBeingModel
{
#region Characteristics
/// <summary>The <see cref="ModelID"/> of the <see cref="Biomes.BiomeRecipe"/> in which this character is at home.</summary>
[Index(5)]
public ModelID NativeBiomeID { get; private set; }
public ModelID NativeBiomeID { get; protected set; }

/// <summary>The <see cref="ModelID"/> of the <see cref="ScriptModel"/> governing the way this being acts.</summary>
[Index(6)]
public ModelID PrimaryBehaviorID { get; private set; }
public ModelID PrimaryBehaviorID { get; protected set; }

/// <summary>Types of parquets this <see cref="BeingModel"/> avoids, if any.</summary>
[Index(7)]
Expand Down
Loading

0 comments on commit 1cc02b4

Please sign in to comment.