public BuildInfo(int buildID, string buildName, BuildCards buildCards, int drawCardNum, int life, int energy, int beginMetal, GamePlaySettings gamePlaySettings) { BuildID = buildID; BuildName = buildName; M_BuildCards = buildCards.Clone(); DrawCardNum = drawCardNum; Life = life; Energy = energy; BeginMetal = beginMetal; GamePlaySettings = gamePlaySettings; }
public static BuildInfo Deserialize(DataStream reader) { int BuildID = reader.ReadSInt32(); string BuildName = reader.ReadString8(); BuildCards m_BuildCards = BuildCards.Deserialize(reader); int DrawCardNum = reader.ReadSInt32(); int Life = reader.ReadSInt32(); int Energy = reader.ReadSInt32(); int BeginMetal = reader.ReadSInt32(); BuildInfo buildInfo = new BuildInfo(BuildID, BuildName, m_BuildCards, DrawCardNum, Life, Energy, BeginMetal, null); return(buildInfo); }
public void Initialize(Editor_CardSelectModes selectMode, BuildCards buildCards) { M_SelectMode = selectMode; if (M_SelectMode == Editor_CardSelectModes.SelectCount) { LanguageManager.Instance.RegisterTextKey(Label, "LevelEditorPanel_CardSelection_SelectCount"); } else if (M_SelectMode == Editor_CardSelectModes.UpperLimit) { LanguageManager.Instance.RegisterTextKey(Label, "LevelEditorPanel_CardSelection_UpperLimit"); } BuildCards = buildCards; Refresh(); RefreshTypeCardCountButtons(CardStatTypes.Total); }
// returns cards which player can build by his resources or by links between cards private List <Card> GetFreeCards() { var result = new List <Card>(); var linkedCards = CardsOnHand.Where(c => BuildCards.Select(bc => bc.UniqCardId).Contains(c.ParentUniqCard)) .ToList(); foreach (var card in CardsOnHand.Except(linkedCards)) { if (card.CardType == (int)CardType.ResourceCard) { if (Coins >= card.CoinsCost) { result.Add(card); } continue; } // var isEnough = card.Price.All(resource => AvaivableResources[resource.Key] > resource.Value); // if(isEnough) result.Add(card); } result.AddRange(linkedCards); return(result); }