static public string GetImagePathPf(CardID card, Team team) { switch (card) { default: return("cards/" + team + "/pf_Errorcard"); case CardID.Blankcard: return("cards/" + team + "/pf_Blankcard"); case CardID.Pointcard: return("cards/" + team + "/pf_Pointcard"); case CardID.Blockcard: return("cards/" + team + "/pf_Blockcard"); case CardID.Indicator: return("emptycards/pf_black"); case CardID.Indicatorred: return("emptycards/pf_red"); case CardID.Startpoint: return("cards/pf_Startpoint"); } }
private void AddEmployee() { //check null if (Name.Trim().Length == 0) { return; } if (CardID.Trim().Length < 9 || CardID.Trim().Length > 12) { return; } if (Phone.Trim().Length == 0) { return; } if (Shift.Trim().Length == 0) { return; } // create mode if (updateEmployee == null) { //add to database EmployeeModel employee = new EmployeeModel(EmployeeModel.GenerateID(), Name, Birthday, CardID, Phone, listPositionModel.List[SelectedIndexPosition].ID, StartDate, Shift); employee.SaveToDatabase(); } else //update mode { EmployeeModel employee = new EmployeeModel(updateEmployee.ID, Name, Birthday, CardID, Phone, listPositionModel.List[SelectedIndexPosition].ID, StartDate, Shift); EmployeeModel.UpdateDatabase(employee); } Cancel(); }
protected override string GetQuery(CodeActivityContext context) { long card = CardID.Get(context); long phase = PhaseID.Get(context); return(string.Format(MoveCardToPhaseQuery, card, phase)); }
protected override bool witnessSuccessHandler(EventWitness witness, DeckController deck, GenericAction callback) { // 角色卡的DefineID int[] charactersDID = witness.getVar <int[]>("masterCardsDID"); // 角色卡的RuntimeID int[] charactersRID = witness.getVar <int[]>("masterCardsRID"); // 玩家卡组 int[] userCards = witness.getVar <int[]>("deck"); // 玩家顺序 int[] playerOrder = witness.getVar <int[]>("sortedPlayersIndex"); // 初始手牌DefineID int[] initHandCard = witness.getVar <int[]>("initCardsDID"); // 初始手牌RuntimeID int[][] initCardsRID = witness.getVar <int[][]>("initCardsRID"); DebugUtils.NullCheck(charactersDID, "charactersDID"); DebugUtils.NullCheck(charactersRID, "charactersRID"); DebugUtils.NullCheck(userCards, "userCards"); DebugUtils.NullCheck(playerOrder, "playerOrder"); DebugUtils.NullCheck(initHandCard, "initHandCard"); DebugUtils.NullCheck(initCardsRID, "initCardsRID"); if (charactersDID.Length != charactersRID.Length) { throw new LengthNotMatchException(charactersDID.Length, charactersRID.Length); } deck.SetPlayer(playerOrder, CardID.ToCardIDs(charactersDID, charactersRID)); deck.SetInitHandcard(initHandCard, initCardsRID); // 先抽卡再设置deck,防止deck中的被抽走( deck.SelfBoard.SetDeck(userCards); return(false); }
public Card(int Value, CardID Name,bool IsPicture) { this.Value = Value; this.Name = Name; this.IsPicture = IsPicture; }
static public string GetImagePathPf(CardID card, Team team) { if (card != CardID.FieldIndicator && card != CardID.FieldIndicatorRed && card != CardID.Startpoint && card != CardID.CardIndicator) { return("cards/" + team + "/pf_" + card); } switch (card) { default: return("cards/" + team + "/pf_Errorcard"); case CardID.FieldIndicator: return("emptycards/pf_transparent"); case CardID.FieldIndicatorRed: return("emptycards/pf_red"); case CardID.Startpoint: return("cards/pf_Startpoint"); case CardID.CardIndicator: return("emptycards/pf_transparent"); } }
public Card(int Value, CardID Name) { this.Value = Value; this.Name = Name; this.IsPicture = false; this.SecondValue = 0; }
private void Clearbtn_Click(object sender, EventArgs e) { CardID.Clear(); Alias.Text = "0"; CardFormats.SelectedIndex = -1; SetCodeLst.SelectedIndex = -1; OtherSetCodeLst.SelectedIndex = -1; Level.SelectedIndex = -1; Race.SelectedIndex = -1; CardAttribute.SelectedIndex = -1; ATK.Text = "0"; DEF.Text = "0"; CardName.Clear(); CardDescription.Clear(); EffectList.Items.Clear(); for (int i = 0; i < CardTypeList.Items.Count; i++) { CardTypeList.SetItemCheckState(i, CheckState.Unchecked); } for (int i = 0; i < CategoryList.Items.Count; i++) { CategoryList.SetItemCheckState(i, CheckState.Unchecked); } m_loadedCard = 0; CardImg.Image = Resources.unknown; m_loadedImage = ""; }
/// <summary> /// 抽一张卡 /// </summary> public void DrawCard(CardID cardID, GenericAction callback) { setCallback(cardID, callback); drawCardInternal(cardID); ReArrangeHandCards(); }
// Update is called once per frame void Update() { ToggleDeleteCardFieldVisibility(); if (animationDone == true) { RemovePlacedCardFromHand(); TogglePlayerScreen(); animationDone = false; } if (triggerDelayedNewRound != 0) { triggerDelayedNewRound = -Time.deltaTime; } if (triggerDelayedNewRound != 0 && triggerDelayedNewRound < 0.5f) { triggerDelayedNewRound = 0; if (lastSetCard == CardID.Deletecard || lastSetCard == CardID.Burncard || lastSetCard == CardID.Nukecard || lastSetCard == CardID.Cancercard || lastSetCard == CardID.Infernocard) { RemoveUnconnectedCards(); lastSetCard = CardID.none; } cardlocked = false; TogglePlayerScreen(); } }
protected override string GetQuery(CodeActivityContext context) { var card = CardID.Get(context); var assignees = AssigneeIDs.Get(context); var dueDate = DueDate.Get(context); var labels = LabelIDs.Get(context); var title = Title.Get(context); var cardFields = new List <string>(); if (assignees?.Length > 0) { cardFields.Add(string.Format("assignee_ids: {0}", assignees.ToQueryValue())); } if (dueDate != null && dueDate != DateTime.MinValue) { cardFields.Add(string.Format("due_date: {0}", dueDate.ToQueryValue())); } if (labels?.Length > 0) { cardFields.Add(string.Format("label_ids: {0}", labels.ToQueryValue())); } if (!string.IsNullOrWhiteSpace(title)) { cardFields.Add(string.Format("title: {0}", title.ToQueryValue())); } var paramsStr = string.Join(" ", cardFields); return(string.Format(UpdateCardQuery, card, paramsStr)); }
public Card TrimValues() { CardID = CardID.Trim(); UserID = UserID.Trim(); Front = Front.Trim(); Back = Back.Trim(); return(this); }
internal CardReference(CardReference cardRef, bool runUpdateAbilities = true) { this.card = cardRef.card; this.cardID = cardRef.cardID; this.old = cardRef; if (runUpdateAbilities) UpdateAbilities(); }
protected override string GetQuery(CodeActivityContext context) { long id = CardID.Get(context); string fieldId = FieldID.Get(context); object fieldValue = Value.Get(context); return(string.Format(UpdateCardFieldQuery, id, fieldId, fieldValue.ToQueryValue())); }
/// <summary> /// 设置自己的ID /// </summary> /// <param name="id"></param> /// <param name="character"></param> public void Init(int id, CardID character, bool isSelf) { SelfID = id; IsSelf = isSelf; characterInfo.CardID = character.CardDID; characterInfo.RuntimeID = character.CardRID; }
public Card(CardID num, CardPower power, Suit cardSuit) { this.ID = num; Value = GetValue(); this.Power = power; this.CardSuit = cardSuit; isTrump = (ID == CardID.Queen || ID == CardID.Jack || CardSuit == Suit.Diamond); }
public Card CreateCardGO(CardID ID, int authorPlayerNum) { GameObject GO = Instantiate(cardPrefab); Card c = GO.GetComponent <Card>(); c.Setup(ID, this, authorPlayerNum); return(c); }
//合并文档,将文档合并到xpsShow.xps里面 public void MergeDocument() { string newFile = Path + "xpsShow.xps"; List <string> lsFileName = new List <string>(); List <string> lstName = new List <string>(); lsFileName.AddRange(Directory.GetFiles(Path)); if (lsFileName.Count == 0) { IsHaveReport = false; return; } lsFileName.Sort(); string[] idCardsStrings = CardID.Split(';'); foreach (string idCardNo in idCardsStrings) { foreach (var item in lsFileName) { if (!string.IsNullOrEmpty(item) && item.Contains(idCardNo)) { lstName.Add(item); } } } FixedDocumentSequence newFds = new FixedDocumentSequence();//创建一个新的文档结构 foreach (var item in lstName) { if (count < 50) { setProcess(count); count++; } if (item != "xpsShow.xps" && item.ToUpper().Contains(".XPS")) { DocumentReference newDocRef = AddPage(item); newFds.References.Add(newDocRef); } } File.Delete(newFile); setProcess(46); //xps写入新文件 XpsDocument NewXpsDocument = new XpsDocument(newFile, System.IO.FileAccess.ReadWrite); XpsDocumentWriter xpsDocumentWriter = XpsDocument.CreateXpsDocumentWriter(NewXpsDocument); setProcess(47); xpsDocumentWriter.Write(newFds); NewXpsDocument.Close(); }
private void setCallback(CardID cardID, GenericAction callback) { if (savedCallback != null) { savedCallback?.Invoke(this, null); } lastDrawCardRID = cardID.CardRID; savedCallback = callback; }
/// Flip face up, and unconceal + setup card details if the card is currently concealed public void Reveal(CardID ID) { // if the card is already revealed, do nothing // this is for the benefit of the player who drew the card if (isConcealed) { Setup(ID, gm, tempPlayerNum); FlipFaceUp(true); } }
public void OnCardClick() { if (!cardlocked) { string name = EventSystem.current.currentSelectedGameObject.name; currentChoosedCardName = name; currentChoosedCardGO = GameObject.Find(name); currentChoosedCard = currentChoosedCardGO.GetComponent <Handcards>().cardid; } }
/// Remove the top cardID from the deck and return it public CardID DrawCard() { if (deck.Count == 0) { Debug.Log("Deck is empty - can't draw card!"); return(null); } CardID ID = deck[0]; deck.Remove(ID); return(ID); }
public override int GetHashCode() { int hashCode = 849365176; hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Term); hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Definition); hashCode = hashCode * -1521134295 + CardID.GetHashCode(); hashCode = hashCode * -1521134295 + IsLearned.GetHashCode(); hashCode = hashCode * -1521134295 + IsStarred.GetHashCode(); return(hashCode); }
public static string GetCardName(CardID card) { switch (card) { default: return(""); case CardID.Blankcard: return("Blankcard"); case CardID.Pointcard: return("Pointcard"); case CardID.Blockcard: return("Blockcard"); case CardID.Doublecard: return("Doublecard"); case CardID.Deletecard: return("Deletecard"); case CardID.Burncard: return("Burncard"); case CardID.Infernocard: return("Infernocard"); case CardID.Changecard: return("Changecard"); case CardID.Cancercard: return("Cancercard"); case CardID.HotPotatoe: return("Discardcard"); case CardID.Nukecard: return("Restartcard"); case CardID.Vortexcard: return("Exchangecard"); case CardID.Anchorcard: return("Anchorcard"); case CardID.Shufflecard: return("Shufflecard"); } }
public static string GetCardDescription(CardID card) { switch (card) { default: return(""); case CardID.Blankcard: return("Use this card to block your opponents moves."); case CardID.Pointcard: return("Place 3 of these cards diagonally, horizontally or vertically in a row to win."); case CardID.Blockcard: return("Blocks a field and reserves an empty, adjacent one for you to use later."); case CardID.Doublecard: return("Places first a Blankcard and later a Pointcard from your deck."); case CardID.Deletecard: return("Destroys any card from the playfield."); case CardID.Burncard: return("Destroys one adjacent card and itself."); case CardID.Infernocard: return("Clears 3 fields in any straight direction, starting from its position."); case CardID.Changecard: return("Turns an opponents pointcard into a blankcard."); case CardID.Cancercard: return("Turns all cards in its line and column into blank cards."); case CardID.HotPotatoe: return("The opponent must discard all special cards on his hand."); case CardID.Nukecard: return("All cards are removed from the playfield."); case CardID.Vortexcard: return("Exchange your deck and handcards with your opponents."); case CardID.Anchorcard: return("Creates a new starting point, max. 2 fields away from other cards."); case CardID.Shufflecard: return("Switches places of your card with enemy card, if they’re adjacent."); } }
public void saveFun() { string[] idCardsStrings = CardID.Split(';'); count = 0; IGetReport igp; foreach (string idCardNo in idCardsStrings) { switch (PrintType) { case "btnHousePhysical": igp = new HousePhysical(); saveInvoke(igp, idCardNo); break; case "btnTypeBUI": igp = new TypeBchao(); igp.CardID = idCardNo; saveInvoke(igp, idCardNo); break; case "btnECG": string ecgType = DrawItems.GetECGConfig(); if (ecgType == "2") { igp = new ElectroCardioGramcs(); igp.CardID = idCardNo; saveInvoke(igp, idCardNo); } else { igp = null; } break; default: igp = null; break; } } Thread.Sleep(1000); setMsg("开始生成合并文档"); MergeInvoke(); CloseWin("test"); }
public CardTemplate(string cardName, string description, int playCost, bool isChargeable, int chargeCost, CardCategory category, CardID ID) { this.cardName = cardName; this.description = description; this.playCost = playCost; this.isChargeable = isChargeable; this.chargeCost = chargeCost; this.cat = category; this.ID = ID; }
/// <summary> /// 内部 生成一张卡 /// </summary> /// <param name="cardID"></param> /// <returns></returns> private CardViewModel drawCardInternal(CardID cardID) { var card = Instantiate(cardfacePrefab, cardSpawnRoot); card.gameObject.SetActive(true); card.CardID = cardID.CardDID; card.RuntimeID = cardID.CardRID; card.Index = handCards.Count; card.OnDestroyEvent += onCardDestroy; card.OnActionEvent += DoAction; handCards.Add(card); cards.Add(card); return(card); }
public void MergeDocument() { string path = Path + "xpsShow.xps"; List <string> list = new List <string>(); List <string> lstName = new List <string>(); list.AddRange(Directory.GetFiles(Path)); list.Sort(); string[] idCardsStrings = CardID.Split(';'); foreach (string idCardNo in idCardsStrings) { foreach (var item in list) { if (!string.IsNullOrEmpty(item) && item.Contains(idCardNo)) { lstName.Add(item); } } } FixedDocumentSequence fixedDocumentSequence = new FixedDocumentSequence(); foreach (string current in lstName) { if (frmShowSave.count < 50) { this.setProcess(frmShowSave.count); frmShowSave.count++; } if (current != "xpsShow.xps" && current.Contains(".xps")) //&& !current.ToUpper().Contains(".PNG") { DocumentReference item = this.AddPage(current); fixedDocumentSequence.References.Add(item); } } File.Delete(path); this.setProcess(46); XpsDocument xpsDocument = new XpsDocument(path, FileAccess.ReadWrite); XpsDocumentWriter xpsDocumentWriter = XpsDocument.CreateXpsDocumentWriter(xpsDocument); this.setProcess(47); xpsDocumentWriter.Write(fixedDocumentSequence); xpsDocument.Close(); }
public override int GetHashCode() { int hash = 1; if (CardID != 0) { hash ^= CardID.GetHashCode(); } if (TargetID != 0) { hash ^= TargetID.GetHashCode(); } if (Extend != 0) { hash ^= Extend.GetHashCode(); } return(hash); }
protected override bool witnessSuccessHandler(EventWitness witness, DeckController deck, GenericAction callback) { int player = witness.getVar <int>("playerIndex"); int[] originalRID = witness.getVar <int[]>("originCardsRID"); int[] cardsRID = witness.getVar <int[]>("replacedCardsRID"); int[] cardsDID = witness.getVar <int[]>("replacedCardsDID", false); DebugUtils.NullCheck(cardsRID, "replacedCardsRID"); DebugUtils.NullCheck(originalRID, "originCardsRID"); if (cardsDID == null) { cardsDID = new int[cardsRID.Length]; } deck.GetUserBoard(player).ThrowCardsWithReplace(CardID.ToCardIDs(originalRID), CardID.ToCardIDs(cardsDID, cardsRID), callback); return(true); }
static public string GetImagePath(CardID card) { switch (card) { default: return("cards/Errorcard"); case CardID.Blankcard: return("cards/Blankcard"); case CardID.Pointcard: return("cards/Pointcard"); case CardID.Startpoint: return("cards/Startpoint"); case CardID.Blockcard: return("cards/Blockcard"); } }
private void Clearbtn_Click(object sender, EventArgs e) { CardID.Clear(); Alias.Text = "0"; CardFormats.SelectedIndex = -1; SetCodeOne.SelectedIndex = -1; SetCodeTwo.SelectedIndex = -1; SetCodeThree.SelectedIndex = -1; SetCodeFour.SelectedIndex = -1; Level.SelectedIndex = -1; RScale.SelectedIndex = 0; LScale.SelectedIndex = 0; Race.SelectedIndex = -1; CardAttribute.SelectedIndex = -1; ATK.Text = "0"; DEF.Text = "0"; CardName.Clear(); CardDescription.Clear(); EffectList.Items.Clear(); for (int i = 0; i < CardTypeList.Items.Count; i++) { CardTypeList.SetItemCheckState(i, CheckState.Unchecked); } for (int i = 0; i < CategoryList.Items.Count; i++) { CategoryList.SetItemCheckState(i, CheckState.Unchecked); } foreach (CheckBox chkBox in linkMarkers.Values) { chkBox.Checked = false; } linkMarkerPanel.Enabled = false; m_loadedCard = 0; CardImg.Image = Resources.unknown; }
internal CardReference(MagicCard card, CardID id) { this.card = card; this.cardID = id; UpdateAbilities(); }