🏗️📦️ Make separate packages for clarity
continuous-integration/drone/push Build is passing Details

pull/55/head
Alexis Drai 3 years ago
parent f52676c901
commit 011db706e0

@ -1,5 +1,6 @@
using Data; using Data;
using Model; using Model.Games;
using System.Diagnostics;
namespace App namespace App
{ {

@ -3,7 +3,7 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using Model; using Model.Games;
namespace Data namespace Data
{ {

@ -1,4 +1,7 @@
using Model; using Model.Dice;
using Model.Dice.Faces;
using Model.Games;
using Model.Players;
namespace Data namespace Data
{ {

@ -1,6 +1,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using Model.Dice.Faces;
namespace Model namespace Model.Dice
{ {
public class Die public class Die
{ {

@ -1,6 +1,6 @@
using System.Collections.Generic; using System.Collections.Generic;
namespace Model namespace Model.Dice
{ {
public class DieManager public class DieManager
{ {

@ -4,7 +4,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Model namespace Model.Dice.Faces
{ {
public abstract class AbstractDieFace public abstract class AbstractDieFace
{ {

@ -4,7 +4,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Model namespace Model.Dice.Faces
{ {
public class ColorDieFace : AbstractDieFace public class ColorDieFace : AbstractDieFace
{ {

@ -4,7 +4,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Model namespace Model.Dice.Faces
{ {
public class ImageDieFace : AbstractDieFace public class ImageDieFace : AbstractDieFace
{ {
@ -29,7 +29,7 @@ namespace Model
public override object GetPracticalValue() public override object GetPracticalValue()
{ {
return String.Format("Assets/images/{0}", Value); return string.Format("Assets/images/{0}", Value);
} }
} }
} }

@ -4,7 +4,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Model namespace Model.Dice.Faces
{ {
public class NumberDieFace : AbstractDieFace public class NumberDieFace : AbstractDieFace
{ {

@ -1,6 +1,6 @@
using System.Collections.Generic; using System.Collections.Generic;
namespace Model namespace Model.Dice
{ {
public class FavGroup public class FavGroup
{ {

@ -1,6 +1,6 @@
using System.Collections.Generic; using System.Collections.Generic;
namespace Model namespace Model.Dice
{ {
public class FavGroupManager public class FavGroupManager
{ {

@ -4,7 +4,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Model namespace Model.Games
{ {
public class Game public class Game
{ {

@ -3,8 +3,10 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using Model.Dice;
using Model.Players;
namespace Model namespace Model.Games
{ {
public class GameRunner public class GameRunner
{ {

@ -1,6 +1,7 @@
using System; using System;
using Model.Players;
namespace Model namespace Model.Games
{ {
/// <summary> /// <summary>
/// a Turn consists of a Player, a DateTime, and a IEnumerable of AbstractDieFace /// a Turn consists of a Player, a DateTime, and a IEnumerable of AbstractDieFace
@ -87,15 +88,15 @@ namespace Model
/// <returns>a turn in string format</returns> /// <returns>a turn in string format</returns>
public override string ToString() public override string ToString()
{ {
return String.Format("{0} -- {1} rolled {2}", return string.Format("{0} -- {1} rolled {2}",
ToStringIsoWithZ(), ToStringIsoWithZ(),
this.player.ToString(), player.ToString(),
"<face>, <face>, <face>..."); "<face>, <face>, <face>...");
} }
private string ToStringIsoWithZ() private string ToStringIsoWithZ()
{ {
return this.when.ToString("s", System.Globalization.CultureInfo.InvariantCulture) + "Z"; return when.ToString("s", System.Globalization.CultureInfo.InvariantCulture) + "Z";
} }
} }
} }

@ -1,6 +1,6 @@
using System; using System;
namespace Model namespace Model.Players
{ {
/// <summary> /// <summary>
/// A player for the purpose of a game of dice, consists of a name /// A player for the purpose of a game of dice, consists of a name
@ -15,7 +15,7 @@ namespace Model
public string Name { get; private set; } public string Name { get; private set; }
public Player(string name) public Player(string name)
{ {
if (!String.IsNullOrWhiteSpace(name)) if (!string.IsNullOrWhiteSpace(name))
{ {
Name = name.Trim(); Name = name.Trim();
} }
@ -40,7 +40,7 @@ namespace Model
return Name.ToUpper() == other.Name.ToUpper(); // equality is case insensitive return Name.ToUpper() == other.Name.ToUpper(); // equality is case insensitive
} }
public override bool Equals(Object obj) public override bool Equals(object obj)
{ {
if (obj is not Player) if (obj is not Player)
{ {

@ -2,7 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
namespace Model namespace Model.Players
{ {
public class PlayerManager : IManager<Player> public class PlayerManager : IManager<Player>
{ {
@ -52,7 +52,7 @@ namespace Model
/// <returns>player with said name, <em>or null</em> if no such player was found</returns> /// <returns>player with said name, <em>or null</em> if no such player was found</returns>
public Player GetOneByName(string name) public Player GetOneByName(string name)
{ {
if (!String.IsNullOrWhiteSpace(name)) if (!string.IsNullOrWhiteSpace(name))
{ {
Player wanted = new(name); Player wanted = new(name);
Player result = players.FirstOrDefault(p => p.Equals(wanted)); Player result = players.FirstOrDefault(p => p.Equals(wanted));

@ -1,4 +1,4 @@
using Model; using Model.Players;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;

@ -1,4 +1,4 @@
using Model; using Model.Players;
using System; using System;
using Xunit; using Xunit;

@ -1,4 +1,5 @@
using Model; using Model.Games;
using Model.Players;
using System; using System;
using Xunit; using Xunit;

Loading…
Cancel
Save