Skip to content

Commit

Permalink
Restructure project, add Spreads
Browse files Browse the repository at this point in the history
  • Loading branch information
oscarcederberg committed Jul 28, 2021
1 parent 58e5aa6 commit a295ea1
Show file tree
Hide file tree
Showing 21 changed files with 43 additions and 2 deletions.
File renamed without changes.
2 changes: 0 additions & 2 deletions Class/IDeck.cs → Classes/IDeck.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System.Collections.Generic;

namespace tarot{
public interface IDeck<T> where T : ICard{
public void DeserializeDeck(string filePath);
Expand Down
13 changes: 13 additions & 0 deletions Classes/ISpread.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using System.Collections.Generic;

namespace tarot{
public interface ISpread<T> where T : ICard{
public void AddCards(IEnumerable<T> cards);

public string SerializeSpread();

public void PrintSpread();

public int Size();
}
}
File renamed without changes.
File renamed without changes.
30 changes: 30 additions & 0 deletions Classes/TarotSpread.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;

namespace tarot{
public class TarotSpread : ISpread<TarotCard>{
private List<TarotCard> _spread;

public TarotSpread(){
this._spread = new List<TarotCard>();
}

public void AddCards(IEnumerable<TarotCard> cards){
this._spread.AddRange(cards);
}

public string SerializeSpread(){
return Utilities.Serialize<List<TarotCard>>(this._spread);
}

public void PrintSpread(){
foreach(TarotCard card in this._spread){
Console.WriteLine(card.ToString());
}
}

public int Size(){
return _spread.Count;
}
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit a295ea1

Please sign in to comment.