Beispiel #1
0
 //image or at least image path if gonna show
 /// <summary>
 /// Create a new hull
 /// </summary>
 /// <param name="name">name of the hull</param>
 /// <param name="speed">base speed of the hull</param>
 /// <param name="man">base manoeuvrability of hull</param>
 /// <param name="det">base detection rating of hull</param>
 /// <param name="hullint">base hull integrity of the hull</param>
 /// <param name="armour">base armour value of the hull</param>
 /// <param name="space">base available space in hull</param>
 /// <param name="sp">cost of the hull</param>
 /// <param name="type">which type(s) this hull can mount components for</param>
 /// <param name="special">special rules for this hull</param>
 /// <param name="origin">rulebook this hull can be found in</param>
 /// <param name="page">page number to find the hull on</param>
 /// <param name="turrets">turret rating of the hull</param>
 /// <param name="prow">number of prow weapon slots</param>
 /// <param name="dorsal">number of dorsal weapon slots</param>
 /// <param name="side">number of port weapon slots</param>
 /// <param name="keel">number of keel weapon slots</param>
 /// <param name="aft">number of aft weapon slots</param>
 /// <param name="frontal">Default prow weapon</param>
 /// <param name="broadside">Default broadside weapons</param>
 /// <param name="comps">Default supplemental components</param>
 /// <param name="command">Command modifier of this hull</param>
 /// <param name="maxspeed">maximum speed of ship. &lt;1 = unlimited</param>
 /// <param name="power">Power generated(or used)by hull, not including built in systems(those should be listed in themselves)</param>
 /// <param name="history">History this hull always has</param>
 /// <param name="bs">Modifier to ballistic skill tests with this hull</param>
 /// <param name="locked">If the ship has been locked so it may not add more armour</param>
 /// <param name="navigate">modifier to navigate warp</param>
 /// <param name="shields">hulltypes of the shields which may be added</param>
 public Hull(string name, int speed, int man, int det, int hullint, int armour, int space, int sp, HullType type,
     String special, RuleBook origin, byte page, int turrets = 1, int prow = 0, int dorsal = 0,
     int side = 0, int keel = 0, int aft = 0, Weapon frontal = null, Weapon broadside = null,
     Supplemental[] comps = null, int command = 0, int maxspeed = 0, int power = 0, ShipHistory history = ShipHistory.None,
     int bs = 0, bool locked = false, int navigate = 0, HullType shields = HullType.None)
     : base(name, sp, power, space, special, origin, page, type)
 {
     this.Speed = speed;
     this.Manoeuvrability = man;
     this.DetectionRating = det;
     this.HullIntegrity = hullint;
     this.Armour = armour;
     this.TurretRating = turrets;
     this.ProwSlots = prow;
     this.DorsalSlots = dorsal;
     this.SideSlots = side;
     this.KeelSlots = keel;
     this.AftSlots = aft;
     this.DefaultProw = frontal;
     this.DefaultBroadside = broadside;
     this.DefaultComponents = comps;
     this.Command = command;
     this.MaxSpeed = maxspeed;
     this.History = history;
     this.BSModifier = bs;
     this.ArmourLocked = locked;
     this.NavigateWarp = navigate;
     this.VoidShields = (shields == HullType.None ? type : shields);
 }
 public SupplementalTemplate(StarshipCreator parent, Supplemental component, int count = 1, int min = 0)
 {
     if (component == null)
         throw new ArgumentException("Cannot create a Template of a null Component");
     this.Parent = parent;
     InitializeComponent();
     this.Component = component;
     Min = min;
     Max = Component.Max;
     Count = count;
     CountDisplay.Content = Count.ToString();
     ComponentName.Text = Component.QualityName + (Count > 1 && !Component.Name.EndsWith("s") ? "s" : "");
     Special.Text = Component.Special;
     CheckAdd();
     CheckRemove();
 }
 public void AddNewSupplemental(Supplemental component, int count = 1, int min = 0, bool update = true)
 {
     SupplementalTemplate template = new SupplementalTemplate(this, component, count, min);
     Grid.SetRow(template, SupplementalRowCount++);
     Grid.SetColumn(template, 0);
     Supplementals.Children.Add(template);
     if (component.AuxiliaryWeapon != null)
         UpdateWeaponSlots(false);
     if (update)
         UpdateSupplementals();
 }
 private void RemoveComponent(Label countLabel, Supplemental component)
 {
     int count = Starship.SupplementalComponents.Count(x => x.Name.Equals(component.Name) && x.Origin == component.Origin);
     Starship.SupplementalComponents.Remove(component);
     countLabel.Content = Starship.SupplementalComponents.Count(x => x.QualityName.Equals(component.QualityName) && x.Origin == component.Origin).ToString();
 }
 private void AddComponent(Label countLabel, Supplemental component)
 {
     int count = Starship.SupplementalComponents.Count(x => x.Name.Equals(component.Name) && x.Origin == component.Origin);
     if (component.Max == 0 || count < component.Max)
     {
         Starship.SupplementalComponents.Add(component);
         countLabel.Content = Starship.SupplementalComponents.Count(x => x.QualityName.Equals(component.QualityName) && x.Origin == component.Origin).ToString();
     }
 }