|
|
|
@ -1,29 +1,22 @@
|
|
|
|
|
using Data.EF.Dice.Faces;
|
|
|
|
|
using Model.Dice.Faces;
|
|
|
|
|
using Model.Dice;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using Model.Dice.Faces;
|
|
|
|
|
|
|
|
|
|
namespace Data.EF.Dice
|
|
|
|
|
{
|
|
|
|
|
public static class NumberDieExtensions
|
|
|
|
|
{
|
|
|
|
|
public static NumberDie ToModel(this NumberDieEntity clrDieEntity)
|
|
|
|
|
public static NumberDie ToModel(this NumberDieEntity dieEntity)
|
|
|
|
|
{
|
|
|
|
|
/*
|
|
|
|
|
* creating an array of faces model
|
|
|
|
|
*/
|
|
|
|
|
NumberFace[] faces = new NumberFace[clrDieEntity.Faces.Count - 1];
|
|
|
|
|
List<NumberFace> clrFacesList = clrDieEntity.Faces.ToModels().ToList();
|
|
|
|
|
clrFacesList.CopyTo(faces, 1);
|
|
|
|
|
NumberFace[] faces = dieEntity.Faces.ToModels().ToArray();
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* creating the die
|
|
|
|
|
*/
|
|
|
|
|
NumberDie die = new(clrDieEntity.Faces.ElementAt(0).ToModel(), faces);
|
|
|
|
|
NumberDie die = new(faces[0], faces[1..]);
|
|
|
|
|
|
|
|
|
|
return die;
|
|
|
|
|
}
|
|
|
|
|