public void UpdatePCard(PhysicalCard p_card) { switch (currentMode) { case InputMode.Dragging: Debug.Log("NOT IMPLEMENTED UPDATEPCARD"); break; case InputMode.Selecting: { Card cardToSelect = p_card.card; p_card.attachedClick.onClick = (() => { if (inputValid) { SelectCard(cardToSelect); } }); p_card.attachedClick.onClick += ZoomDisplay.instance.Hide; } break; case InputMode.Playing: p_card.attachedClick.onClick = (() => { if (inputValid) { p_card.card.PlayIfPlayable(); } }); p_card.attachedClick.onClick += ZoomDisplay.instance.Hide; break; } }
public PhysicalCard DrawCard(Zone target) { PhysicalCard createdCard = PhysicalCardFactory.CreateCard(cards[0]); cards[0].MoveTo(target); return(createdCard); }
public static PhysicalCard CreateCard(Card c) { GameObject obj = Instantiate(instance.prefab); PhysicalCard pcard = obj.GetComponent <PhysicalCard>(); pcard.Associate(c); return(pcard); }
void InstantiatePhysicalCardForHand(Card card) { GameObject prefab = Resources.Load("Prefabs/Cards/PhysicalCard") as GameObject; GameObject obj = (GameObject)MonoBehaviour.Instantiate(prefab); PhysicalCard tempCard = obj.AddComponent <PhysicalCard_Hand>(); card.AssignPhysicalRepresentation(tempCard); }
void MoveCard(DragBehaviour behaviour) { PhysicalCard attachedCard = behaviour.GetComponent <PhysicalCard>(); if (attachedCard != null) { attachedCard.card.MoveTo(this); } }
public void Serialize() { //using(SqlConnection con = new SqlConnection()) //{ // using (SqlCommand cmd = new SqlCommand()) // { // con.Open(); // cmd.Connection = con; // cmd.CommandText = "INSERT INTO TABLE() VALUE "; // int v = cmd.ExecuteNonQuery(); // } //} FileStream file = new FileStream(@"C:\Projects\pic.jpg", FileMode.Open); byte[] bytes = new byte[file.Length]; file.Read(bytes, 0, bytes.Length); string base64 = Convert.ToBase64String(bytes, Base64FormattingOptions.None); file.Close(); List <string> names = new List <string>() { "AAA", "BBB", "CCC" }; for (int c = 0; c < names.Count; c++) { string name = names[c]; List <PhysicalCard> physicalCards = new List <PhysicalCard>(); for (int i = 0; i < 1500; i++) { PhysicalCard physicalCard = new PhysicalCard(); physicalCard.Name = name + i.ToString().PadLeft(8, '0'); physicalCard.Age = i % 60; physicalCard.Sex = i % 2 == 0 ? "男" : "女"; physicalCard.Card = "123456789" + (i).ToString().PadLeft(9, '0'); physicalCard.Pic = base64; physicalCards.Add(physicalCard); } FileStream file2 = new FileStream(@"D:\ftp_test\NotUpload\" + name + ".helloworld", FileMode.Create); BinaryFormatter binaryFormatter = new BinaryFormatter(); binaryFormatter.Serialize(file2, physicalCards); file2.Close(); } }
static void Main(string[] args) { ICard card1 = new PhysicalCard("a1", 123, DateTime.Today.AddDays(1)); ICard card2 = new VirtualOneTimeCard("a2", 123, DateTime.Today.AddDays(1)); ICard card3 = new VirtualPermanentCard("a3", 123, DateTime.Today.AddDays(1)); ICard card4 = new VirtualPermanentCard("a4", 123, DateTime.Now); ICard card5 = new PhysicalCard("a5", 123, DateTime.Today.AddDays(1)); ICard card6 = new PhysicalCard("a6", 123, DateTime.Today.AddDays(-1)); Account account1 = new BGNAccount("12311", 100); Account account2 = new BGNAccount("12322", 100); Account account3 = new BGNAccount("12333", 100); Account account4 = new BGNAccount("12344", 100); Account account5 = new BGNAccount("12355", 100); Account account6 = new BGNAccount("12366", 100); Account account7 = new EURAccount("12367", 100); Account[] accounts = new Account[7]; accounts[0] = account1; accounts[1] = account2; accounts[2] = account3; accounts[3] = account4; accounts[4] = account5; accounts[5] = account6; accounts[6] = account7; ICard[] cards = new Card[6]; cards[0] = card1; cards[1] = card2; cards[2] = card3; cards[3] = card4; cards[4] = card5; cards[5] = card6; IRevolutAPI revolut = new Revolut(accounts, cards); Console.WriteLine(revolut.PayOnline(card3, 123, 50, "BGN", "site.biz")); Console.WriteLine(revolut.PayOnline(card3, 123, 100, "BGN", "site1.com")); Console.WriteLine(revolut.PayOnline(card2, 123, 50, "BGN", ".biz.site1.com")); Console.WriteLine(revolut.PayOnline(card2, 123, 1, "BGN", "site1.com")); Console.WriteLine(revolut.Pay(card1, 123, 50, "BGN")); Console.WriteLine(revolut.TransferMoney(account1, account2, 30)); Console.WriteLine(revolut.GetTotalAmount()); Console.WriteLine(revolut.AddMoney(account3, 1000)); Console.WriteLine(revolut.GetTotalAmount()); }
public void AssignPhysicalRepresentation(PhysicalCard physicalCard) { DestroyPhysicalRepresentation(); PhysicalCard = physicalCard; }
/// <summary> /// This is to make sure that every TransitCard implementation has a constructor. /// What this gives is a member, mCard, which is available to children of the implementation so that they are not required to remember where they put it... /// </summary> /// <param name="c">a PhysicalCard snapshot.</param> protected TransitCard(PhysicalCard.PhysicalCard c) { mCard = c; }