public Buyable(BuyableClass _type, int _count) { // this.type = _type; this.name = _type.name; this.id = _type.id; this.description = _type.description; this.prerequisites = _type.prerequisites; long[] type_cost = _type.cost; this.total_cost = new long[] { type_cost[0] * _count, type_cost[1] * _count, type_cost[2] * _count }; this.total_cost[BuyableClass.labor] /= _count; this.cost_left = new long[this.total_cost.Length]; this.total_cost.CopyTo(this.cost_left, 0); this.count = _count; this.done = false; }
public Tech ( BuyableClass _type, bool _known, int _danger, string _tech_type, int _secondary_data ) // public Tech (string _id, string _description, bool _known, long[] _cost, List<string> _prerequisites, int _danger, string _tech_type, int _secondary_data) // : base( new BuyableClass (_id, _description, _cost, _prerequisites, "tech"), 1) :base( _type, 1 ) { this.type = _type; this.danger = _danger; this.result = ""; this.tech_type = _tech_type; this.secondary_data = _secondary_data; if (_known) { // self.finish would re-apply the tech benefit, which is already in // place. base.finish (); } }
public Tech(BuyableClass _type, bool _known, int _danger, string _tech_type, int _secondary_data) // public Tech (string _id, string _description, bool _known, long[] _cost, List<string> _prerequisites, int _danger, string _tech_type, int _secondary_data) // : base( new BuyableClass (_id, _description, _cost, _prerequisites, "tech"), 1) : base(_type, 1) { this.type = _type; this.danger = _danger; this.result = ""; this.tech_type = _tech_type; this.secondary_data = _secondary_data; if (_known) { // self.finish would re-apply the tech benefit, which is already in // place. base.finish(); } }
public Buyable (BuyableClass _type, int _count) { // this.type = _type; this.name = _type.name; this.id = _type.id; this.description = _type.description; this.prerequisites = _type.prerequisites; long[] type_cost = _type.cost; this.total_cost = new long[] { type_cost[0] * _count, type_cost[1] * _count, type_cost[2] * _count }; this.total_cost[BuyableClass.labor] /= _count; this.cost_left = new long[this.total_cost.Length]; this.total_cost.CopyTo( this.cost_left, 0 ); this.count = _count; this.done = false; }