-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #52 from rena0157/Add-Subcatchments
I am going to merge this branch for now and come back to it to finish testing.
- Loading branch information
Showing
16 changed files
with
823 additions
and
6 deletions.
There are no files selected for viewing
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace Droplet.Core.Inp.Entities | ||
{ | ||
/// <summary> | ||
/// Interface that defines a class that will host entity data | ||
/// </summary> | ||
public interface IEntityDataHost<T> where T : class | ||
{ | ||
/// <summary> | ||
/// Add entity data to it's host | ||
/// </summary> | ||
/// <param name="entityData">The data that will be added to this host</param> | ||
void AddEntityData(T entityData); | ||
} | ||
} |
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,23 @@ | ||
namespace Droplet.Core.Inp.Entities | ||
{ | ||
/// <summary> | ||
/// Interface that defines the X, Y and Z coordinates for a node | ||
/// </summary> | ||
public interface INode | ||
{ | ||
/// <summary> | ||
/// The X coordinate of the node | ||
/// </summary> | ||
double X { get; } | ||
|
||
/// <summary> | ||
/// The Y coordinate of the node | ||
/// </summary> | ||
double Y { get; } | ||
|
||
/// <summary> | ||
/// The Z coordinate of the node | ||
/// </summary> | ||
double Z { get; } | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
using Droplet.Core.Inp.Data; | ||
using Droplet.Core.Inp.Utilities; | ||
using System; | ||
using System.Globalization; | ||
|
||
namespace Droplet.Core.Inp.Entities | ||
{ | ||
/// <summary> | ||
/// Class that represents added data to an entity. For example the sub-area entity is added | ||
/// data to the subcatchment entity. | ||
/// </summary> | ||
abstract public class InpEntityData : IInpEntity | ||
{ | ||
/// <summary> | ||
/// Default Constructor | ||
/// </summary> | ||
public InpEntityData() | ||
{ | ||
ID = Guid.NewGuid(); | ||
var resources = new InpResourceManager(); | ||
Name = Description = Tag = resources.GetString("DefaultProperty", CultureInfo.CurrentCulture); | ||
} | ||
|
||
/// <summary> | ||
/// Internal constructor that accepts a <see cref="IInpTableRow"/> and an <see cref="IInpDatabase"/> | ||
/// that will be used to construct the data and set the database for this entity. This constructor sets | ||
/// the <see cref="Name"/> as the first element in the row and creates a <see cref="Guid.NewGuid"/> for its | ||
/// <see cref="ID"/>. | ||
/// </summary> | ||
/// <param name="row">The row that will be used to construct this entity data</param> | ||
/// <param name="database">The database that this entity belongs to</param> | ||
internal InpEntityData(IInpTableRow row, IInpDatabase database) | ||
{ | ||
_ = row ?? throw new ArgumentNullException(nameof(row)); | ||
_ = database ?? throw new ArgumentNullException(nameof(database)); | ||
|
||
var resources = new InpResourceManager(); | ||
|
||
Name = row[0]; | ||
Database = database; | ||
ID = Guid.NewGuid(); | ||
Description = Tag = resources.GetString("DefaultProperty", CultureInfo.CurrentCulture); | ||
} | ||
|
||
/// <summary> | ||
/// The name of the reference Entity | ||
/// </summary> | ||
public string Name { get; } | ||
|
||
/// <summary> | ||
/// The optional Description for the entity | ||
/// </summary> | ||
public string Description { get; } | ||
|
||
/// <summary> | ||
/// The optional Tag for the entity | ||
/// </summary> | ||
public string Tag { get; } | ||
|
||
/// <summary> | ||
/// The database Guid for the entity | ||
/// </summary> | ||
public Guid ID { get; } | ||
|
||
/// <summary> | ||
/// The database that the entity belongs to | ||
/// </summary> | ||
public IInpDatabase? Database { get; } | ||
|
||
/// <summary> | ||
/// Abstract method that converts this entity to an inp string | ||
/// </summary> | ||
/// <returns>Returns: A formatted inp string</returns> | ||
public abstract string ToInpString(); | ||
} | ||
} |
Oops, something went wrong.