Ejemplo n.º 1
0
 /// <summary>
 /// Retrieve fields to instanciate a Wonder.
 /// </summary>
 /// <param name="wonderDAO">The object containing the wonder information.</param>
 /// <returns>A new Wonder</returns>
 private static Wonder GetWonder(WonderDAO wonderDAO)
 {
     return(new Wonder(
                wonderDAO.ID,
                wonderDAO.Name,
                wonderDAO.Side,
                (Card.ResourceType)wonderDAO.BaseResource,
                GetSteps(wonderDAO)
                ));
 }
Ejemplo n.º 2
0
    /// <summary>
    /// Cast a WonderDAO steps array into the Wonder applicable steps array.
    /// </summary>
    /// <param name="wonderDAO">The object containing the steps information.</param>
    /// <returns>The list of wonder steps.</returns>
    private static List <Step> GetSteps(WonderDAO wonderDAO)
    {
        List <Step> steps = new List <Step>();

        foreach (WonderDAO.StepDAO stepDAO in wonderDAO.Steps)
        {
            steps.Add(new Step(
                          CardsDAO.GetResources(stepDAO.StepBuildCondition.ToList()),
                          stepDAO.StepTypes.Cast <StepType>().ToArray(),
                          stepDAO.Reward != null ? CardsDAO.GetReward(stepDAO.Reward.ToList()): new BonusCard.RewardQuantity[0],
                          stepDAO.WarPoints,
                          (AcquisitionType)stepDAO.TradeType,
                          (BonusCard.ResourceMetaType)stepDAO.Resources,
                          (BuilderType)stepDAO.BuildType
                          ));
        }

        return(steps);
    }