Skip to content

Commit

Permalink
Add new constructor for DataTable class
Browse files Browse the repository at this point in the history
  • Loading branch information
PolinaSavelyeva committed Nov 15, 2023
1 parent 050e6de commit 723e956
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## [Unreleased]

### Added
- New constructor for `DataTable` class

## [1.0.0-alpha3] - 2023-11-15

### Fixed
Expand Down
10 changes: 10 additions & 0 deletions src/RoomInteriorGenerator/DataTable.fs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,16 @@ type DataTableRow<'Value> =
else
Some(DynamicLengthArray leafsArray.Value) }

new(name, instancesArray, placementRule, leafsArray: array<DataTableRow<'Value>>) =
{ Name = name
Variants = DynamicLengthArray instancesArray
PlacementRule = placementRule
LeafsTable =
if Array.isEmpty leafsArray then
Option.None
else
Some(DynamicLengthArray leafsArray) }

/// <summary>
/// Restores the variants array to its original length.
/// </summary>
Expand Down

0 comments on commit 723e956

Please sign in to comment.