public static async Task ExchangeCard(bool IsPlayerWash = true) { await WashCard(); await DrawCard(); CardBoardCommand.LoadCardList(RowsInfo.GetMyCardList(RegionTypes.Hand)); //UiCommand.CardBoardReload(); }
private void btnAdd_Click(object sender, EventArgs e) { MyRow row = new MyRow(textBox1.Text, textBox2.Text); //row.id = textBox1.Text; //row.name = textBox2.Text; RowsInfo.Instance().add(row); RowsInfo.Instance().save(); reloadListView(); }
private void reloadListView() { lsvData.Items.Clear(); foreach (MyRow row in RowsInfo.Instance().rows) { ListViewItem item = new ListViewItem(row.id); item.SubItems.Add(row.name); lsvData.Items.Add(item); } }
public static async Task DisCard(Card card = null) { Card TargetCard = card == null ? GlobalBattleInfo.PlayerPlayCard : card; TargetCard.IsPrePrepareToPlay = false; TargetCard.Row.Remove(TargetCard); RowsInfo.GetMyCardList(RegionTypes.Grave).Add(TargetCard); TargetCard.Trigger <TriggerType.Discard>(); //await CardEffectStackControl.TriggerEffect<TriggerType.Discard>(TargetCard); //GlobeBattleInfo.IsCardEffectCompleted = true; }
public async Task CreatTempCard() { //print("创建临时卡片"+ RowsInfo.GetRegionCardList(RegionName_Other.My_Uesd).ThisRowCard[0].CardId); SingleInfo.TempCard = await CardCommand.CreatCard(RowsInfo.GetRegionCardList(RegionName_Other.My_Uesd).ThisRowCard[0].CardId); SingleInfo.TempCard.IsTemp = true; SingleInfo.TempCard.IsCanSee = true; SingleInfo.ThisRowCard.Insert(SingleInfo.Rank, SingleInfo.TempCard); SingleInfo.TempCard.Init(); }
public static async Task PlayCard() { SoundControl.Play(); GameCommand.PlayCardLimit(true); Card TargetCard = GlobalBattleInfo.PlayerPlayCard; TargetCard.IsPrePrepareToPlay = false; RowsInfo.GetMyCardList(RegionTypes.Hand).Remove(TargetCard); RowsInfo.GetMyCardList(RegionTypes.Uesd).Add(TargetCard); GlobalBattleInfo.PlayerPlayCard = null; TargetCard.Trigger <TriggerType.Deploy>(); }
public void PrintSummary(SummaryInfo si, RowsInfo ri) { rprtCostSummary rprt = new rprtCostSummary(); FPreviewAR pv = new FPreviewAR(); pv.projNumber = si.project; rprt.SummaryInformation = si; rprt.RowsInfo = ri; rprt.Run(); rprt.Document.Print(true, false); }
public void PreviewSummary(SummaryInfo si, RowsInfo ri) { rprtCostSummary rprt = new rprtCostSummary(); FPreviewAR pv = new FPreviewAR(); rprt.SummaryInformation = si; rprt.RowsInfo = ri; rprt.Run(); pv.projNumber = si.project; //*******************************Added 9/30/2015 pv.ViewReport(rprt); pv.ShowDialog(); }
public static async Task MoveCard() { Card TargetCard = GlobalBattleInfo.TargetCard; GlobalBattleInfo.TargetCard = null; List <Card> OriginRow = RowsInfo.GetRow(TargetCard); List <Card> TargetRow = GlobalBattleInfo.SelectRegion.ThisRowCard; print("移动卡牌从" + OriginRow.Count + "到" + TargetRow.Count); OriginRow.Remove(TargetCard); TargetRow.Insert(GlobalBattleInfo.SelectLocation, TargetCard); //GlobalBattleInfo.SelectLocation //GlobalBattleInfo.SelectRegion = RowsInfo.GetRegionCardList(RegionName_Other.My_Hand); }
/// <summary> /// 获取可视区域节点 /// </summary> /// <param name="treeList">TreeList</param> /// <param name="conditonHanlder">条件委托</param> /// <returns>可视区域节点集合</returns> public static List <TreeListNode> GetVisibleNodes(this TreeList treeList, Predicate <TreeListNode> conditonHanlder) { List <TreeListNode> _visibleNodes = new List <TreeListNode>(); RowsInfo _rowsInfo = treeList.ViewInfo.RowsInfo; foreach (RowInfo ri in _rowsInfo.Rows) { TreeListNode _curNode = ri.Node; if (conditonHanlder(_curNode)) { _visibleNodes.Add(_curNode); } } return(_visibleNodes); }
public static async Task Deploy() { //Card card = RowsInfo.GetRegionCardList(RegionName_Other.My_Uesd).ThisRowCard[0]; //RowsInfo.GetRegionCardList(RegionName_Other.My_Uesd).ThisRowCard.Remove(card); Card card = RowsInfo.GetMyCardList(RegionTypes.Uesd)[0]; RowsInfo.GetMyCardList(RegionTypes.Uesd).Remove(card); //Card card = GlobalBattleInfo.MyUse[0]; //GlobalBattleInfo.MyUse.Remove(card); GlobalBattleInfo.SelectRegion.ThisRowCard.Insert(GlobalBattleInfo.SelectLocation, card); GlobalBattleInfo.SelectRegion = null; GlobalBattleInfo.SelectLocation = -1; //部署特效 //print("duang"); await Task.Delay(2000); }
//private void ComputeTableSize() //{ //} public override string ToString() { var rowHeadersWidth = RowsInfo.Max(r => r.Header.Length); var colHeadersWidth = ColumnsInfo.Max(c => c.Header.Length); var maxItemWidth = Math.Max(rowHeadersWidth, colHeadersWidth); for (var c = 0; c < Columns; c++) { for (var r = 0; r < Rows; r++) { var item = Items[r, c]; if (!string.IsNullOrEmpty(item) && maxItemWidth < item.Length) { maxItemWidth = item.Length; } } } var composer = new LinearTextComposer(); //Add column headers composer.Append(FormatItem("", maxItemWidth)); for (var c = 0; c < Columns; c++) { composer.Append(FormatItem(ColumnsInfo[c].Header, maxItemWidth)); } composer.AppendLine(); //Add rows for (var r = 0; r < Rows; r++) { composer.Append(FormatItem(RowsInfo[r].Header, maxItemWidth)); for (var c = 0; c < Columns; c++) { composer.Append(FormatItem(Items[r, c], maxItemWidth)); } composer.AppendLine(); } return(composer.ToString()); }
//static int num = 0; public static async Task BattleStart() { await Task.Run(async() => { //await Task.Delay(500); UiCommand.SetNoticeBoardTitle("对战开始"); UiCommand.NoticeBoardShow(); await Task.Delay(2000); UiCommand.NoticeBoardHide(); CardDeck Deck = AllPlayerInfo.Player1Info.UseDeck; for (int i = 0; i < Deck.CardIds.Count; i++) { //print("我方创造卡片"); Card NewCard = await CardCommand.CreatCard(Deck.CardIds[i]); if (GlobalBattleInfo.IsPlayer1) { RowsInfo.GetDownCardList(RegionTypes.Deck).Add(NewCard); } else { RowsInfo.GetUpCardList(RegionTypes.Deck).Add(NewCard); } //NewCard.Init(); } Deck = AllPlayerInfo.Player2Info.UseDeck; for (int i = 0; i < Deck.CardIds.Count; i++) { //print("敌方创造卡片"); Card NewCard = await CardCommand.CreatCard(Deck.CardIds[i]); if (GlobalBattleInfo.IsPlayer1) { RowsInfo.GetUpCardList(RegionTypes.Deck).Add(NewCard); } else { RowsInfo.GetDownCardList(RegionTypes.Deck).Add(NewCard); } } await Task.Delay(2000); }); //print("结束对战准备"); }
public static void SetRegionSelectable(bool CanBeSelected) { if (CanBeSelected) { Card DeployCard = RowsInfo.GetMyCardList(RegionTypes.Uesd)[0]; bool IsMyTerritory = (DeployCard.CardTerritory == Territory.My); switch (RowsInfo.GetMyCardList(RegionTypes.Uesd)[0].CardProperty) { case Property.Water: { SetRowShow(IsMyTerritory ? RegionName_Battle.My_Water : RegionName_Battle.Op_Water); break; } case Property.Fire: { SetRowShow(IsMyTerritory ? RegionName_Battle.My_Fire : RegionName_Battle.Op_Fire); break; } case Property.Wind: { SetRowShow(IsMyTerritory ? RegionName_Battle.My_Wind : RegionName_Battle.Op_Wind); break; } case Property.Soil: { SetRowShow(IsMyTerritory ? RegionName_Battle.My_Soil : RegionName_Battle.Op_Soil); break; } case Property.None: break; default: break; } } else { RowsInfo.Instance.SingleBattleInfos.Values.ToList().ForEach(row => row.Control.SetSelectable(false)); } }
public static async Task DrawCard(bool IsPlayerDraw = true, bool ActiveBlackList = false) { SoundControl.Play(); Card TargetCard = IsPlayerDraw ? RowsInfo.GetMyCardList(RegionTypes.Deck)[0] : RowsInfo.GetOpCardList(RegionTypes.Deck)[0]; TargetCard.IsCanSee = IsPlayerDraw; if (IsPlayerDraw) { RowsInfo.GetMyCardList(RegionTypes.Deck).Remove(TargetCard); RowsInfo.GetMyCardList(RegionTypes.Hand).Add(TargetCard); } else { RowsInfo.GetOpCardList(RegionTypes.Deck).Remove(TargetCard); RowsInfo.GetOpCardList(RegionTypes.Hand).Add(TargetCard); } await OrderCard(); await Task.Delay(100); }
// Update is called once per frame void Update() { if (Input.GetMouseButtonDown(4)) { print("yaya" + Command.AiCommand.GetRandom(0, 10)); GlobalBattleInfo.TargetCard = RowsInfo.GetDownCardList(RegionTypes.Hand)[0]; Command.CardCommand.WashCard(); //RowsInfo.GetRegionCardList(RegionName_Battle.My_Water).Add(NewCard); //GameObject NewCard = Instantiate(CardLibrary.Instance.Card_Model); //print(NewCard.name); } if (Input.GetMouseButtonDown(3)) { //CardCommand.DrawCard(); //Card b = a.ThisRowCard[0]; //a.ThisRowCard.Remove(b); //Destroy(b.gameObject); } }
//洗回牌库 public static async Task WashCard(bool IsPlayerWash = true) { print("洗牌"); if (IsPlayerWash) { int MaxCardRank = Info.RowsInfo.GetMyCardList(RegionTypes.Deck).Count; int CardRank = AiCommand.GetRandom(0, MaxCardRank); GlobalBattleInfo.SelectLocation = CardRank; GlobalBattleInfo.SelectRegion = RowsInfo.GetRegionCardList(RegionName_Other.My_Deck); GlobalBattleInfo.TargetCard = GlobalBattleInfo.SingleSelectCardOnBoard; GlobalBattleInfo.TargetCard.IsCanSee = false; await MoveCard(); } else { //int MaxCardRank = Info.RowsInfo.GetDownCardList(RegionTypes.Hand).Count; //int CardRank = AiCommand.GetRandom(0, MaxCardRank); //GlobalBattleInfo.SelectLocation = CardRank; //GlobalBattleInfo.SelectRegion = RowsInfo.GetRegionCardList(RegionName_Other.My_Hand); //await MoveCard(); } await Task.Delay(500); }
protected override void CalcRowsDrawInfo() { if (AllowUpdateDetails) { EditFormBounds = Rectangle.Empty; } CalcDataRight(); ViewRects.EmptyRows = Rectangle.Empty; int bottom = ViewRects.Rows.Bottom; GridRow row = null; int visibleCount = RowsLoadInfo.ResultRows.Count; bool bottomPositionUpdated = false; ViewRects.RowsTotalHeight = 0; DevExpress.XtraGrid.Drawing.GridColumnInfoArgs lastColumnInfo = ColumnsInfo.LastColumnInfo; GridRowInfo lastRow = null; RowsCache.UpdateCache(RowsLoadInfo.ResultRows); for (int n = 0; n < visibleCount; n++) { row = RowsLoadInfo.ResultRows[n]; if (!bottomPositionUpdated && IView.IsPixelScrollingCore) { bottomPositionUpdated = CheckUpdateTopPositionCore(row, ref bottom); if (bottomPositionUpdated && lastRow != null && lastRow.ForcedRow) { if (lastRow.TotalBounds.Top < bottom) { lastRow.DrawMoreIcons = true; } } } GridRowInfo cached = CheckRowCache(row.RowHandle, row.VisibleIndex, bottom); GridRowInfo ri; GridRow nextRow = (n + 1 < visibleCount ? RowsLoadInfo.ResultRows[n + 1] : null); int rowLineHeight = -1; if (cached == null) { rowLineHeight = CalcRowHeight(GInfo.Graphics, row.RowHandle, row.VisibleIndex, row.Level); cached = CheckRowCacheReusable(row, bottom - rowLineHeight, rowLineHeight); } if (cached != null && row.RowHandle == View.FocusedRowHandle && View.IsEditFormVisible) { cached = null; } if (cached != null) { RowsCache.RemoveRow(cached); GridDataRowInfo cachedDataRow = cached as GridDataRowInfo; bool allowCachedRow = cachedDataRow == null || cachedDataRow.DetailBounds.IsEmpty; if (cachedDataRow != null && cachedDataRow.EditFormRow) { allowCachedRow = false; } if (allowCachedRow) { lastRow = ri = cached; bottom = ri.TotalBounds.Top; ri.ForcedRow = row.ForcedRow; ri.ForcedRowLight = row.ForcedRowLight; ri.DrawMoreIcons = !row.NextRowPrimaryChild && (row.ForcedRow || (ri.IsGroupRow && ri.IsGroupRowExpanded)); RowsInfo.AddRow(ri); if (bottom < ViewRects.Rows.Top) { break; } continue; } } lastRow = ri = CreateRowInfo(row); Rectangle rowBounds = ViewRects.Rows; rowBounds = ViewRects.Rows; rowBounds.Y = bottom; ri.RowLineHeight = rowLineHeight > 0 ? rowLineHeight : CalcRowHeight(GInfo.Graphics, ri.RowHandle, ri.VisibleIndex, ri.Level); rowBounds.Height = ri.RowLineHeight * GetRowLineCount(ri.RowHandle, ri.IsGroupRow); rowBounds.Y -= rowBounds.Height; ri.Bounds = rowBounds; rowBounds.Height = CalcTotalRowHeight(GInfo.Graphics, ri.RowLineHeight, ri.RowHandle, ri.VisibleIndex, ri.Level, ri.IsGroupRow ? (bool?)null : (bool?)true); ri.TotalBounds = rowBounds; if (IsExternalRowCore(ri.RowHandle)) { ri.Bounds = ri.TotalBounds; } CalcRowIndents(ri); ri.RowFooters.RowFooterCount = GetRowFooterCountEx(ri.RowHandle, ri.VisibleIndex, (ri.IsGroupRow ? (bool?)null : (bool?)true)); ri.RowFooters.RowFootersHeight = ri.RowFooters.RowFooterCount * GroupFooterHeight; CalcDataRow(ri as GridDataRowInfo, row, nextRow); CalcGroupRow(ri as GridGroupRowInfo, row, nextRow); CalcExternalRow(ri as GridExternalRowInfo, row, nextRow); //add rowSeparator bottom = ri.TotalBounds.Top; RowsInfo.AddRow(ri); if (bottom < ViewRects.Rows.Top) { break; } } //RemoveAnimatedItems(RowsCache.Rows); ViewRects.RowsTotalHeight = ViewRects.Rows.Bottom - bottom; if (bottom > ViewRects.Rows.Top) { Rectangle r = ViewRects.Rows; r.Y = ViewRects.Rows.Top; r.Height = bottom - ViewRects.Rows.Top; ViewRects.EmptyRows = r; } //CalcRowsMergeInfo(); //if(AllowUpdateDetails) { // CheckEditFormVisibility(); //} IView.ResetAllowUpdateRowIndexesCore(); }
private static void SetRowShow(RegionName_Battle row) { RowsInfo.GetRegionCardList(row).Control.SetSelectable(true); }
/// <summary> /// 限制手牌被打出 /// </summary> /// <param name="IsOpen"></param> public static void PlayCardLimit(bool IsLimit) { RowsInfo.GetRegionCardList(RegionName_Other.My_Hand).ThisRowCard.ForEach(card => card.IsLimit = IsLimit); }