Esempio n. 1
0
        public void TestMethod1()
        {
            BCDataStorage data = OATBeanCounterData.data;

            data.OnEncodeToConfigNode();
            Assert.AreEqual(data.data_version, "0.01");
        }
Esempio n. 2
0
        internal override void DrawWindow(int id)
        {
            if (GUILayout.Button("Reset database"))
            {
                OATBeanCounterData.NukeFromOrbit();
            }

            BCDataStorage data = OATBeanCounterData.data;

            GUILayout.Label(String.Format("Launches: {0}", data.launches.Count));
            GUILayout.Label(String.Format("Recoveries: {0}", data.recoveries.Count));
            GUILayout.Label(String.Format("Transactions: {0}", data.transactions.Count));
            GUILayout.Label(String.Format("Funds: {0}", data.funds));
        }
        // TODO: EVERYTHING IN HERE IS HORRIBLE THIS IS JUST A PROOF OF CONCEPT
        internal override void DrawWindow(int id)
        {
            BCDataStorage data = OATBeanCounterData.data;

            // TODO: OH MY GOD SERIOUSLY DO NOT SHIP WITH THIS CODE

            // TransactionReasons.VesselRollout
            List <BCTransactionData> rollouts =
                (from trans in OATBeanCounterData.data.transactions
                 where trans.reason == TransactionReasons.VesselRollout
                 select trans).ToList();

            double costs_rollout = rollouts.Sum(t => t.amount);

            GUILayout.Label(String.Format("Rollouts {0}", CurrencyFormat(costs_rollout)));

            // TransactionReasons.VesselRecovery
            List <BCTransactionData> recovery =
                (from trans in OATBeanCounterData.data.transactions
                 where trans.reason == TransactionReasons.VesselRecovery
                 select trans).ToList();

            double costs_recovery = recovery.Sum(t => t.amount);

            GUILayout.Label(String.Format("Recoveries {0}", CurrencyFormat(costs_recovery)));

            // TransactionReasons.Strategies
            List <BCTransactionData> strategies =
                (from trans in OATBeanCounterData.data.transactions
                 where trans.reason == TransactionReasons.Strategies
                 select trans).ToList();

            double costs_strategies = strategies.Sum(t => t.amount);

            GUILayout.Label(String.Format("Strategies {0}", CurrencyFormat(costs_strategies)));

            // TransactionReasons.StrategySetup
            List <BCTransactionData> strategysetup =
                (from trans in OATBeanCounterData.data.transactions
                 where trans.reason == TransactionReasons.StrategySetup
                 select trans).ToList();

            double costs_strategysetup = strategysetup.Sum(t => t.amount);

            GUILayout.Label(String.Format("Strategy Setups {0}", CurrencyFormat(costs_strategysetup)));
        }
 public static void NukeFromOrbit()
 {
     data = new BCDataStorage();
 }
 public static void NukeFromOrbit()
 {
     data = new BCDataStorage();
 }