private void RemoveTime(BudgetEntryXml entry)
        {
            TimeableList <BudgetEntryXml> config = TLMLineUtils.GetEffectiveConfigForLine(UVMPublicTransportWorldInfoPanel.GetLineID()).BudgetEntries;

            if (config != default)
            {
                config.RemoveAtHour(entry.HourOfDay ?? -1);
                m_isDirty = true;
            }
        }
        private void AddEntry()
        {
            TimeableList <BudgetEntryXml> config = TLMLineUtils.GetEffectiveConfigForLine(UVMPublicTransportWorldInfoPanel.GetLineID()).BudgetEntries;

            config.Add(new BudgetEntryXml()
            {
                HourOfDay = 0,
                Value     = 100
            });
            RebuildList(UVMPublicTransportWorldInfoPanel.GetLineID());
        }
Exemplo n.º 3
0
        public void RebuildList(ushort lineID)
        {
            TimeableList <TicketPriceEntryXml> config = TLMLineUtils.GetEffectiveConfigForLine(lineID).TicketPriceEntries;
            int stopsCount = config.Count;

            if (stopsCount == 0)
            {
                config.Add(new TicketPriceEntryXml()
                {
                    HourOfDay = 0,
                    Value     = 0
                });
            }

            RecountRows(config, stopsCount, ref TransportManager.instance.m_lines.m_buffer[lineID]);
            RedrawList();
        }
        public void RebuildList(ushort lineID)
        {
            Interfaces.IBasicExtensionStorage effectiveConfig = TLMLineUtils.GetEffectiveConfigForLine(lineID);
            TimeableList <BudgetEntryXml>     budgetEntries   = effectiveConfig.BudgetEntries;
            int stopsCount = budgetEntries.Count;

            if (stopsCount == 0)
            {
                budgetEntries.Add(new BudgetEntryXml()
                {
                    HourOfDay = 0,
                    Value     = effectiveConfig is TLMTransportLineConfiguration ? 100u : TransportManager.instance.m_lines.m_buffer[lineID].m_budget
                });
            }

            RecountRows(budgetEntries, stopsCount);
            RedrawList();
        }