-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
299 additions
and
85 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace Bible.Core.Models | ||
{ | ||
public class BibleChapter | ||
{ | ||
public BibleReference Reference { get; set; } = default!; | ||
|
||
public int ChapterNumber { get; set; } | ||
|
||
public IReadOnlyList<BibleVerse> Verses { get; set; } = default!; | ||
|
||
public override bool Equals(object other) => | ||
other is BibleChapter p && p.Reference.Equals(Reference); | ||
|
||
public override int GetHashCode() => | ||
Reference.GetHashCode(); | ||
|
||
public override string ToString() => | ||
Reference.ToString(); | ||
} | ||
} |
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 |
---|---|---|
@@ -1,11 +1,50 @@ | ||
namespace Bible.Core.Models | ||
using System.Collections.Generic; | ||
|
||
namespace Bible.Core.Models | ||
{ | ||
public class BibleReference | ||
{ | ||
public string Book { get; set; } = string.Empty; | ||
public BibleReference() { } | ||
|
||
public BibleReference(BibleReference bibleReference) | ||
{ | ||
Translation = bibleReference.Translation; | ||
BookName = bibleReference.BookName; | ||
Aliases = bibleReference.Aliases; | ||
Reference = bibleReference.Reference; | ||
} | ||
|
||
/// <summary> | ||
/// Version of the bible used. | ||
/// </summary> | ||
public string Translation { get; set; } = default!; | ||
|
||
/// <summary> | ||
/// Unabreviated name of the book. | ||
/// </summary> | ||
public string BookName { get; set; } = default!; | ||
|
||
/// <summary> | ||
/// Abreviated or alternative names of the book. | ||
/// </summary> | ||
public IReadOnlyList<string>? Aliases { get; set; } | ||
|
||
/// <summary> | ||
/// Optional chapter and verse reference. | ||
/// </summary> | ||
public string? Reference { get; set; } | ||
|
||
public override bool Equals(object other) => other is BibleReference p && | ||
(p.Translation, p.BookName, p.Reference).Equals((Translation, BookName, Reference)); | ||
|
||
public int Chapter { get; set; } = 1; | ||
public override int GetHashCode() => | ||
(Translation, BookName, Reference).GetHashCode(); | ||
|
||
public int[]? Verses { get; set; } | ||
public override string ToString() | ||
{ | ||
if (string.IsNullOrEmpty(Reference)) | ||
return $"{BookName} ({Translation})"; | ||
return $"{BookName} {Reference} {Translation}"; | ||
} | ||
} | ||
} |
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,20 @@ | ||
namespace Bible.Core.Models | ||
{ | ||
public class BibleVerse | ||
{ | ||
public BibleReference Reference { get; set; } = default!; | ||
|
||
public int VerseNumber { get; set; } | ||
|
||
public string Text { get; set; } = default!; | ||
|
||
public override bool Equals(object other) => | ||
other is BibleVerse p && p.Reference.Equals(Reference); | ||
|
||
public override int GetHashCode() => | ||
Reference.GetHashCode(); | ||
|
||
public override string ToString() => | ||
$"\"{Text}\" {Reference}"; | ||
} | ||
} |
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
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
Oops, something went wrong.