Exemple #1
0
        void updateItemList(bool changed = false)
        {
            var n = shipsComboBox.Items[shipsComboBox.SelectedIndex] as string;
            var s = dict[n];

            if (changed)
            {
                label10.Text = string.Format(@"{0}% kills
{1}% losses", s.Kills, s.Losses);
                shipPictureBox.LoadAsync(EVE.getRenderUriById(s.Id));
            }
            listView2.Items.Clear();
            if (radioButton1.Checked)
            {
                label8.Text = @"Showing weapon usage of this
7 days, found in killmails.";
                listView2.Columns[1].Text = "%";
                foreach (var x in s.UsedWeapons.OrderByDescending(y => y.Item2))
                {
                    listView2.Items.Add(new ListViewItem(new[] { x.Item1.Item1, x.Item2.ToString() }));
                }
            }

            else if (radioButton2.Checked)
            {
                label8.Text = @"Showing amount of items
destroyed in last 7 days.";
                listView2.Columns[1].Text = "x";
                foreach (var x in s.Mods.OrderByDescending(y => y.Item2))
                {
                    listView2.Items.Add(new ListViewItem(new[] { x.Item1.Item1, x.Item2.ToString() }));
                }
            }
        }
Exemple #2
0
    public ValueTask ExecuteAsync(IConsole console)
    {
        EVE.Unpack(FilePath);

        console.Output.WriteLine("Complete!");

        return(default);
    public ValueTask ExecuteAsync(IConsole console)
    {
        EVE.Pack(EveFolder);

        console.Output.WriteLine("Complete!");

        return(default);
Exemple #4
0
    public void IdenticalThroughLoadSaveCycle(string eventFileName)
    {
        string eventFile = Path.Combine(TestConstants.TestModFolder, "event", eventFileName);

        var eve = new EVE(eventFile);

        string tempFile = Path.Combine(TestTempFolder, "saved.eve");

        eve.Save(tempFile);

        var expectedBytes = File.ReadAllBytes(eventFile);
        var actualBytes   = File.ReadAllBytes(tempFile);

        actualBytes.Should().Equal(expectedBytes);
    }
Exemple #5
0
    public void ReadsFileCorrectly(string eventFileName, int fileId, int headerUnknown, int eventGroupCount, int subgroupCount)
    {
        string eventFile = Path.Combine(TestConstants.TestModFolder, "event", eventFileName);

        var eve = new EVE(eventFile);

        eve.FileId.Should().Be(fileId);
        eve.HeaderUnknown.Should().Be(headerUnknown);

        eve.EventGroupsA.Should().HaveCount(eventGroupCount);
        eve.EventGroupsB.Should().HaveCount(eventGroupCount);

        eve.EventGroupsA.Sum(i => i.Count).Should().Be(subgroupCount);
        eve.EventGroupsB.Sum(i => i.Count).Should().Be(subgroupCount);
    }
Exemple #6
0
        public TacticalAnalyser(int _id, string name = null)
        {
            id   = _id;
            dict = new Dictionary <string, Ship>();
            InitializeComponent();

            if (name == null)
            {
                this.Text = "TacticalAnalyser - " + EVE.getCharaNameById(id);
            }
            else
            {
                this.Text = name;
            }
            s = getKillDetail(id).Publish().RefCount();

            listView1.ColumnWidthChanged += Program.GenerateListLocker(listView1);
            listView2.ColumnWidthChanged += Program.GenerateListLocker(listView2);
        }
Exemple #7
0
    public void IndenticalThroughUnpackPack(string eventFileName)
    {
        string eventFile = Path.Combine(TestConstants.TestModFolder, "event", eventFileName);

        string tempDir = Path.Combine(TestTempFolder, "unpacked");

        if (Directory.Exists(tempDir))
        {
            Directory.Delete(tempDir, true);
        }
        Directory.CreateDirectory(tempDir);
        EVE.Unpack(eventFile, tempDir);
        string tempFile = Path.Combine(TestTempFolder, "packed.eve");

        EVE.Pack(tempDir, tempFile);

        var expectedBytes = File.ReadAllBytes(eventFile);
        var actualBytes   = File.ReadAllBytes(tempFile);

        actualBytes.Should().Equal(expectedBytes);
    }
Exemple #8
0
        private void TacticalAnalyser_Shown(object sender, EventArgs e)
        {
            var p = s.SubscribeOn(NewThreadScheduler.Default)
                    .ObserveOn(SynchronizationContext.Current);

            p.OfType <Tactical.Message.ShipInfo>()
            .Subscribe(xs =>
            {
                label1.Visible = false;
                var s          = shipChart.Series[0];
                foreach (var x in xs.Item)
                {
                    var name = x.Item1.Item1;
                    var id   = x.Item1.Item2;
                    var kr   = x.Item2;
                    var dr   = x.Item3;
                    if (double.IsNaN(kr))
                    {
                        kr = 0;
                    }
                    if (double.IsNaN(dr))
                    {
                        dr = 0;
                    }
                    dict.Add(name, new Ship()
                    {
                        Id          = id,
                        Name        = name,
                        Kills       = kr,
                        Losses      = dr,
                        UsedPercent = kr,
                        Mods        = x.Item4,
                        UsedWeapons = x.Item5
                    });
                    shipsComboBox.Items.Add(name);
                    if (kr != 0)
                    {
                        var dp       = s.Points.Add(kr);
                        dp.AxisLabel = string.Format("{0}{2}{1}%", name, kr, Environment.NewLine);
                    }
                    if (!s.Points.Any())
                    {
                        label1.Text    = "NO DATA";
                        label1.Visible = true;
                        //var dp = s.Points.Add(100);
                    }
                }
                var path = new System.Drawing.Drawing2D.GraphicsPath();
                path.AddEllipse(new Rectangle(0, 0, 110, 110));
                pictureBox1.Region   = new Region(path);
                pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage;
                pictureBox1.LoadAsync(EVE.getIconUriById(id));

                if (shipsComboBox.Items.Count > 0)
                {
                    shipsComboBox.Enabled       = listView2.Enabled = radioButton1.Enabled = radioButton2.Enabled = true;
                    label7.Visible              = false;
                    shipsComboBox.SelectedIndex = 0;
                    shipsComboBox_SelectedIndexChanged(this, null);
                }
                else
                {
                    label7.Text = "NO DATA";
                }
            }, Program.FailWith);

            p.OfType <Tactical.Message.Gang>()
            .Subscribe(xs =>
            {
                foreach (var x in xs.Item)
                {
                    listView1.Items.Add(new ListViewItem(new[] { x.Item1, x.Item2.ToString() }));
                }
                kosButton.Enabled = true;
            });

            p.OfType <Tactical.Message.TzInfo>()
            .Subscribe(xs =>
            {
                if (xs.Item.All(x => x.Item2 == 0))
                {
                    label5.Text    = "NO DATA";
                    label5.Visible = true;
                }
                else
                {
                    label5.Visible          = false;
                    label6.Visible          = true;
                    var s                   = tzChart.Series[0];
                    var ca                  = tzChart.ChartAreas[0];
                    ca.AxisX.Interval       = 3;
                    ca.AxisX.IntervalOffset = 1;
                    ca.AxisX.Maximum        = 25;
                    foreach (var x in xs.Item)
                    {
                        var t       = s.Points.Add(x.Item2);
                        t.AxisLabel = x.Item1.ToString();
                    }
                }
            });
        }