-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reworked the FBD model. Moved to single Block.cs class. Added factory…
… methods for creating different elements and blocks.
- Loading branch information
Showing
44 changed files
with
1,526 additions
and
2,788 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
using System; | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
|
||
namespace L5Sharp.Common; | ||
|
||
public class TagMap : IEnumerable<KeyValuePair<TagName, TagName>> | ||
{ | ||
private readonly List<KeyValuePair<TagName, TagName>> _map = new(); | ||
|
||
/// <summary> | ||
/// Represents a mapping class for tags. | ||
/// </summary> | ||
public TagMap() | ||
{ | ||
} | ||
|
||
/// <summary> | ||
/// | ||
/// </summary> | ||
/// <param name="from"></param> | ||
/// <param name="to"></param> | ||
/// <exception cref="ArgumentNullException"></exception> | ||
/// <exception cref="ArgumentException"></exception> | ||
public void Map(TagName from, TagName to) | ||
{ | ||
if (from is null) throw new ArgumentNullException(nameof(from)); | ||
if (to is null) throw new ArgumentNullException(nameof(to)); | ||
if (from.IsEmpty) throw new ArgumentException("Can not create mapping for empty tag."); | ||
if (to.IsEmpty) throw new ArgumentException("Can not create mapping for empty tag."); | ||
_map.Add(new KeyValuePair<TagName, TagName>(from, to)); | ||
} | ||
|
||
/// <inheritdoc /> | ||
public IEnumerator<KeyValuePair<TagName, TagName>> GetEnumerator() => _map.GetEnumerator(); | ||
|
||
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.