Compare commits
	
		
			No commits in common. "91bca70168f9ea2674e85ba06a60e8b1c4fbfdcd" and "d79ee5a1538f8685cf9d27ef8cc8c44d5b16d8df" have entirely different histories.
		
	
	
		
			91bca70168
			...
			d79ee5a153
		
	
		
@ -43,9 +43,6 @@ public class CombatZone : Transaction {
 | 
			
		||||
    /// </summary>
 | 
			
		||||
    public int OptionalObjectivesCompleted {
 | 
			
		||||
        get {
 | 
			
		||||
            if (IsGround) {
 | 
			
		||||
                return 0;
 | 
			
		||||
            }
 | 
			
		||||
            return new List<bool?>() { SpecOps, Captain, Correspondent, CapitalShip }
 | 
			
		||||
                .Where(x => x != null && x == true)
 | 
			
		||||
                .Count()
 | 
			
		||||
@ -53,20 +50,6 @@ public class CombatZone : Transaction {
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /// <summary>
 | 
			
		||||
    /// Returns true if it is an on foot/ground combat zone
 | 
			
		||||
    /// </summary>
 | 
			
		||||
    public bool IsGround {
 | 
			
		||||
        get { return string.Compare(Type, "On Foot") == 0; }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /// <summary>
 | 
			
		||||
    /// Returns true if it is an on foot combat zone
 | 
			
		||||
    /// </summary>
 | 
			
		||||
    public bool IsShip {
 | 
			
		||||
        get { return string.Compare(Type, "Ship") == 0; }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public override int CompareTo(Transaction? obj) {
 | 
			
		||||
        if (obj == null || obj.GetType() != typeof(CombatZone)) {
 | 
			
		||||
            return -1;
 | 
			
		||||
 | 
			
		||||
@ -19,19 +19,11 @@ class CombatZoneFormat : LogFormatter {
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        foreach (var log in logs) {
 | 
			
		||||
            int optionals = log.Value
 | 
			
		||||
                                .Sum(x => x.OptionalObjectivesCompleted)
 | 
			
		||||
                                ;
 | 
			
		||||
            builder.AppendFormat("Won {0}x {1} {2} Combat Zones",
 | 
			
		||||
            builder.AppendFormat("Won {0}x {1} {2} Combat Zones\n",
 | 
			
		||||
                log.Value.Count, 
 | 
			
		||||
                log.Key.Grade,
 | 
			
		||||
                log.Key.Type
 | 
			
		||||
                );
 | 
			
		||||
 | 
			
		||||
            if (optionals > 0) {
 | 
			
		||||
                builder.AppendFormat(" (with {0} optional objectives)", optionals);
 | 
			
		||||
            }
 | 
			
		||||
            builder.Append("\n");
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return builder.ToString().Trim();
 | 
			
		||||
 | 
			
		||||
@ -84,11 +84,6 @@
 | 
			
		||||
                                            </StackPanel>
 | 
			
		||||
                                            <Separator Visibility="Hidden" Grid.Column="1" HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch" />
 | 
			
		||||
                                            <StackPanel Grid.Column="2" Orientation="Horizontal" HorizontalAlignment="Right" x:Name="CombatZone" Visibility="{Binding IsCombatZone}">
 | 
			
		||||
                                                <ToggleButton x:Name="CapitalShip" Margin="2,0,2,0" Content="Capital Ship" Visibility="{Binding IsShipCombatZone}" IsChecked="{Binding HasCapitalShip, Mode=TwoWay}" IsThreeState="False"/>
 | 
			
		||||
                                                <ToggleButton x:Name="Captain" Margin="2,0,2,0" Content="Captain" Visibility="{Binding IsShipCombatZone}" IsChecked="{Binding HasCaptain, Mode=TwoWay}" IsThreeState="False"/>
 | 
			
		||||
                                                <ToggleButton x:Name="Correspondent" Margin="2,0,2,0" Content="Correspondent" Visibility="{Binding IsShipCombatZone}" IsChecked="{Binding HasCorrespondent, Mode=TwoWay}" IsThreeState="False"/>
 | 
			
		||||
                                                <ToggleButton x:Name="SpecOps" Margin="2,0,2,0" Content="Spec Ops" Visibility="{Binding IsShipCombatZone}" IsChecked="{Binding HasSpecOps, Mode=TwoWay}" IsThreeState="False"/>
 | 
			
		||||
                                                <Separator Margin="2,0,2,0" VerticalAlignment="Top"/>
 | 
			
		||||
                                                <Button x:Name="Low" Content="Low" Click="Low_Click"/>
 | 
			
		||||
                                                <Separator Margin="2,0,2,0" VerticalAlignment="Top"/>
 | 
			
		||||
                                                <Button Content="Med" x:Name="Med" Click="Med_Click" />
 | 
			
		||||
 | 
			
		||||
@ -25,97 +25,6 @@ public class UITransaction {
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public Visibility IsShipCombatZone {
 | 
			
		||||
        get {
 | 
			
		||||
            CombatZone? combat = Transaction as CombatZone;
 | 
			
		||||
            if (combat == null) {
 | 
			
		||||
                return Visibility.Hidden;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            if (string.Compare(combat.Type, "Ship") == 0) {
 | 
			
		||||
                return Visibility.Visible;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            return Visibility.Hidden;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public bool? HasSpecOps {
 | 
			
		||||
        get {
 | 
			
		||||
            CombatZone? combat = Transaction as CombatZone;
 | 
			
		||||
            if (combat == null) {
 | 
			
		||||
                return false;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            return combat.SpecOps ?? false;
 | 
			
		||||
        }
 | 
			
		||||
        set {
 | 
			
		||||
            CombatZone? combat = Transaction as CombatZone;
 | 
			
		||||
            if (combat == null) {
 | 
			
		||||
                return;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            combat.SpecOps = value;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public bool? HasCapitalShip {
 | 
			
		||||
        get {
 | 
			
		||||
            CombatZone? combat = Transaction as CombatZone;
 | 
			
		||||
            if (combat == null) {
 | 
			
		||||
                return false;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            return combat.CapitalShip ?? false;
 | 
			
		||||
        }
 | 
			
		||||
        set {
 | 
			
		||||
            CombatZone? combat = Transaction as CombatZone;
 | 
			
		||||
            if (combat == null) {
 | 
			
		||||
                return;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            combat.CapitalShip = value;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public bool? HasCaptain {
 | 
			
		||||
        get {
 | 
			
		||||
            CombatZone? combat = Transaction as CombatZone;
 | 
			
		||||
            if (combat == null) {
 | 
			
		||||
                return false;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            return combat.Captain ?? false;
 | 
			
		||||
        }
 | 
			
		||||
        set {
 | 
			
		||||
            CombatZone? combat = Transaction as CombatZone;
 | 
			
		||||
            if (combat == null) {
 | 
			
		||||
                return;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            combat.Captain = value;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public bool? HasCorrespondent {
 | 
			
		||||
        get {
 | 
			
		||||
            CombatZone? combat = Transaction as CombatZone;
 | 
			
		||||
            if (combat == null) {
 | 
			
		||||
                return false;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            return combat.Correspondent ?? false;
 | 
			
		||||
        }
 | 
			
		||||
        set {
 | 
			
		||||
            CombatZone? combat = Transaction as CombatZone;
 | 
			
		||||
            if (combat == null) {
 | 
			
		||||
                return;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            combat.Correspondent = value;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /// <summary>
 | 
			
		||||
    /// Profit from selling, used in the XAML ui for binding
 | 
			
		||||
    /// </summary>
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user