public BbLevels(IReadOnlyList<BbLevel> levels){//TODO: check var first=levels[0]; var second=levels[1]; BcCost=first.BcCost; First=first.Effects; Change=new Effect[levels[0].Effects.Length]; for(var i=0;i<levels[0].Effects.Length;i++) Change[i]=second.Effects[i]-first.Effects[i]; Dc=first.Dc; }
public static Effect operator-(Effect left,Effect right){ //TODO: double click goes to Effects tab, which disables clicking on mainwindow, metal/jewel tab, squad tab, animation tab with test dummy var result=new Effect(); foreach(var p in typeof(Effect).GetProperties()){ dynamic difference=0; if(p.PropertyType==typeof(int)) difference=((int)p.GetValue(left))-((int)p.GetValue(right)); else if(p.PropertyType==typeof(decimal)) difference=((decimal)p.GetValue(left))-((decimal)p.GetValue(right)); if(difference!=0) p.SetValue(result,difference); }//TODO: IIsNotDefault return result; }