-
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.
- Loading branch information
1 parent
c241b78
commit df0a6f3
Showing
3 changed files
with
40 additions
and
17 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,11 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace tarot{ | ||
public interface ISpread<T> where T : ICard{ | ||
public void AddCards(IEnumerable<T> cards); | ||
public interface ISpread<T, U> where T : IDeck<U> where U : ICard { | ||
public void AddCards(T deck); | ||
|
||
public string SerializeSpread(); | ||
|
||
public void PrintSpread(); | ||
|
||
public int Size(); | ||
public int GetLength(); | ||
} | ||
} |
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,30 +1,34 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
|
||
namespace tarot{ | ||
public class TarotSpread : ISpread<TarotCard>{ | ||
private List<TarotCard> _spread; | ||
public class TarotSpread : ISpread<TarotDeck, TarotCard>{ | ||
private TarotCard[] _spread_cards; | ||
private string[] _spread_positions; | ||
|
||
public TarotSpread(){ | ||
this._spread = new List<TarotCard>(); | ||
public TarotSpread(string[] positions, TarotDeck deck){ | ||
this._spread_positions = positions; | ||
this._spread_cards = new TarotCard[GetLength()]; | ||
AddCards(deck); | ||
} | ||
|
||
public void AddCards(IEnumerable<TarotCard> cards){ | ||
this._spread.AddRange(cards); | ||
public void AddCards(TarotDeck deck){ | ||
for (int i = 0; i < GetLength(); i++){ | ||
this._spread_cards[i] = deck.RequeueCard(); | ||
} | ||
} | ||
|
||
public string SerializeSpread(){ | ||
return Utilities.Serialize<List<TarotCard>>(this._spread); | ||
return Utilities.Serialize<TarotCard[]>(this._spread_cards); | ||
} | ||
|
||
public void PrintSpread(){ | ||
foreach(TarotCard card in this._spread){ | ||
Console.WriteLine(card.ToString()); | ||
for (int i = 0; i < GetLength(); i++){ | ||
Console.WriteLine($"{i}. {_spread_positions[i]}:\n\t{_spread_cards[i]}"); | ||
} | ||
} | ||
|
||
public int Size(){ | ||
return _spread.Count; | ||
public int GetLength(){ | ||
return _spread_positions.Length; | ||
} | ||
} | ||
} |
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,21 @@ | ||
{ | ||
"Linear 3 Card Spread": [ | ||
"Past, you, situation, idea", | ||
"Present, your path/relationship, action, process", | ||
"Future, your potential/partner, outcome, aspiration" | ||
], | ||
"Making Decisions": [ | ||
"Your motivation", | ||
"Ideal outcome", | ||
"Your values", | ||
"Option 1, likely outcome", | ||
"Option 2, likely outcome" | ||
], | ||
"Hierarchy of Needs": [ | ||
"Physiological", | ||
"Safety", | ||
"Love and belonging", | ||
"Esteem", | ||
"Self-actualization" | ||
] | ||
} |