public void AddToCharacteristicValue(CharacteristicName name, int amountToAdd) { int value = GetValue(name); value += amountToAdd; SetValue(name, value); }
/// <summary> /// Create characteristic /// </summary> /// <param name="name"></param> /// <param name="firstAptitude"></param> /// <param name="secondAptitude"></param> /// <param name="rank"></param> public Characteristic(CharacteristicName name, AptitudeName firstAptitude, AptitudeName secondAptitude, int rank = 0) { Name = name; FirstAptitude = firstAptitude; SecondAptitude = secondAptitude; Rank = rank; }
public CharacteristicSet(CharacteristicName a, int ppa, CharacteristicName b, int ppb, CharacteristicName c, int ppc) { CharA = a; CharB = b; CharC = c; PointsPerA = ppa; PointsPerB = ppb; PointsPerC = ppc; }
public void SetValue(CharacteristicName name, int newValue) { if (newValue == 0) { values[(int)name] = newValue; halfValues[(int)name] = newValue; fifthValues[(int)name] = newValue; return; } values[(int)name] = newValue; halfValues[(int)name] = CalculateHalfValue(newValue); fifthValues[(int)name] = CalculateFifthValue(newValue); }
static void getCharacteristicNames() { Console.Write("CATEGORY CHARACTERISTICS NAME: "); DataTable rawData = Utility.OpenExcel(sourceData, "CharacteristicName"); int N = 0; foreach (DataRow row in rawData.Rows) { string catName = Utility.getString(row, 0); ResourceCategory resource = context.ResourceCategories.FirstOrDefault(x => x.CategoryName == catName); CharacteristicName characteristic = new CharacteristicName() { ResourceCategory = resource, Name = Utility.getString(row, 1) }; N++; context.CharacteristicNames.Add(characteristic); } context.SaveChanges(); Console.WriteLine(N); }
public CommandSetCardState(Int32 cid, CharacteristicName st) { Card = new LazyGameObject <Card>(cid); NewState = st; }
public void SetCharacteristicValue(CharacteristicName name, int value) { characteristics.SetValue(name, value); }
public int GetCharacteristicValue(CharacteristicName name) { return(characteristics.GetValue(name)); }
public int GetHalfValue(CharacteristicName characteristic) { return((int)halfValues[(int)characteristic]); }
public int GetValue(CharacteristicName characteristic) { int index = (int)characteristic; return((int)values[index]); }
public int GetFifthValue(CharacteristicName characteristic) { return((int)fifthValues[(int)characteristic]); }
public CardView(Game g, Card crd, Player v, CharacteristicName cn, CardView ForceAltView = null) { id = crd.ID; CardCharacteristics chara; ZoneType zone = g.GetZoneTypeOf(crd); chara = crd.MyCharacteristics[cn]; if ((zone == ZoneType.Hand || zone == ZoneType.Library) && !g.DebugFlag.Contains(DebugMode.CardViews)) { if (v.ID != crd.Owner.ID) { chara = crd.MyCharacteristics[CharacteristicName.FaceDown]; } } Name = chara.Name; SuperTypes = chara.SuperTypes.AsReadOnly(); CardTypes = chara.CardTypes.AsReadOnly(); SubTypes = chara.SubTypes.AsReadOnly(); String txt = ""; foreach (Activatable act in chara.Activatables) { txt += act.ToString(g) + Environment.NewLine; } Text = txt; Power = chara.Power; Toughness = chara.Toughness; AssignedDamage = crd.AssignedDamage; IsTapped = crd.IsTapped; HasSummoningSickness = crd.HasSummoningSickness; Counters = crd.MyCounters.Select(x => { return((CounterView)x.Value(g).GetView(g, v)); }).ToList().AsReadOnly(); if (ForceAltView != null) { AlternateView = ForceAltView; } else { if (cn == CharacteristicName.Flip || cn == CharacteristicName.FaceDown || cn == CharacteristicName.Back || cn == CharacteristicName.Manifest || cn == CharacteristicName.Morph) { AlternateView = new CardView(g, crd, v, CharacteristicName.Front, this); } if (cn == CharacteristicName.Front) { if (crd.MyCharacteristics.ContainsKey(CharacteristicName.Flip)) { AlternateView = new CardView(g, crd, v, CharacteristicName.Flip, this); } else if (crd.MyCharacteristics.ContainsKey(CharacteristicName.Back)) { AlternateView = new CardView(g, crd, v, CharacteristicName.Back, this); } else { AlternateView = null; } } } }