Esempio n. 1
0
        public static DLI Load(Map map, XElement dliElement)
        {
            byte row        = (byte)Int32.Parse(dliElement.Attribute("row").Value);
            byte colbak     = (byte)Int32.Parse(dliElement.Attribute("colbk").Value);
            byte colpf0     = (byte)Int32.Parse(dliElement.Attribute("colpf0").Value);
            byte colpf1     = (byte)Int32.Parse(dliElement.Attribute("colpf1").Value);
            byte colpf2     = (byte)Int32.Parse(dliElement.Attribute("colpf2").Value);
            byte colpf3     = (byte)Int32.Parse(dliElement.Attribute("colpf3").Value);
            var  OrderValue = OrderEntry.GetNormalizedValue(dliElement.Attribute("order")?.Value);
            var  Order      = OrderEntry.GetEntries().Find(val => val.Value == OrderValue.ToString());

            return(new DLI(map, new AtariPFColors(colbak, colpf3, colpf2, colpf1, colpf0), row, Order, false));
        }
Esempio n. 2
0
        public XElement Save()
        {
            XElement result = new XElement("dli");

            result.Add(new XAttribute("order", OrderEntry.GetNormalizedValue(OrderValue)));
            result.Add(new XAttribute("row", IntLine));
            result.Add(new XAttribute("colbk", AtariPFColors.Colbk));
            result.Add(new XAttribute("colpf0", AtariPFColors.Colpf0));
            result.Add(new XAttribute("colpf1", AtariPFColors.Colpf1));
            result.Add(new XAttribute("colpf2", AtariPFColors.Colpf2));
            result.Add(new XAttribute("colpf3", AtariPFColors.Colpf3));
            return(result);
        }
Esempio n. 3
0
        private Dictionary <RbgPFColors.PlayFieldColor, byte> SortColors(Dictionary <RbgPFColors.PlayFieldColor, byte> colorsDelta, object orderValue)
        {
            Dictionary <RbgPFColors.PlayFieldColor, byte> result = new Dictionary <RbgPFColors.PlayFieldColor, byte>();

            var OrderValue = OrderEntry.GetNormalizedValue(orderValue);

            OrderEntry Order = OrderEntry.GetEntries().Find(val => val.Value == OrderValue.ToString());

            foreach (var color in Order.Order)
            {
                if (colorsDelta.ContainsKey(color))
                {
                    result.Add(color, colorsDelta[color]);
                }
            }

            return(result);
        }
Esempio n. 4
0
        static public List <OrderEntry> GetEntries()
        {
            if (_entries == null)
            {
                IEnumerable <IEnumerable <RbgPFColors.PlayFieldColor> > order = GetOrfer();

                List <OrderEntry> ord = new List <OrderEntry>();
                foreach (IEnumerable <RbgPFColors.PlayFieldColor> listColor in order)
                {
                    OrderEntry orderEntry = new OrderEntry();
                    orderEntry.Order = listColor;
                    ord.Add(orderEntry);
                }

                _entries = ord;
            }

            return(_entries);
        }
Esempio n. 5
0
 private void populateOrderCombo()
 {
     comboBoxOrder.DisplayMember = "Value";
     comboBoxOrder.ValueMember   = "Value";
     comboBoxOrder.DataSource    = OrderEntry.GetEntries();
 }