Esempio n. 1
0
        protected override bool ConvertBase(object[] values, string parameter, string stateName, IEnumerable <CEOptionDescriptor> options)
        {
            RowResource        rowResource = (RowResource)values[2];
            int                position    = (int)values[3];
            CEOptionDescriptor option      = options.FirstOrDefault(x => x.Action == ProgrammingRowCommon.RowResourceAction[rowResource] && x.Position == position);

            return(option != null);
        }
 public RowModel(int i, RowResource resource)
 {
     HasOptional  = i % 2 == 1;
     Position     = i;
     Resource     = resource;
     SlotReward   = slotRewardDict[resource][i];
     SlotOptional = slotOptionalDict[resource][i];
 }
Esempio n. 3
0
        public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
        {
            RowResource rowResource = (RowResource)values[1];

            RowModel[] rows = Enumerable.Range(0, 5).Select(x => new RowModel(x, rowResource)).ToArray();
            CEBoardSlotDescriptor[] slots = (CEBoardSlotDescriptor[])values[0];
            if (slots.Length > 0)
            {
                for (int i = 0; i < 5; i++)
                {
                    if (slots[i].Card != null)
                    {
                        rows[i] = new RowModel(i, slots[i].CardObject);
                    }
                    else
                    {
                        rows[i] = new RowModel(i, rowResource);
                    }
                }
            }
            return(rows);
        }