Ejemplo n.º 1
0
        internal static CellBom FindCellBomAtFrom(string productID, string prodVer, CellActionType actionType)
        {
            List <CellBom> list = GetCellBomAtFrom(productID, actionType);

            if (list == null || list.Count == 0)
            {
                return(null);
            }

            CellBom bom = null;

            foreach (var item in list)
            {
                if (actionType != CellActionType.None && item.ActionType != actionType)
                {
                    continue;
                }

                if (LcdHelper.IsEmptyID(item.CellCode))
                {
                    continue;
                }

                if (prodVer != Constants.ALL && prodVer != item.FromProductVer)
                {
                    continue;
                }

                bom = item;
                break;
            }

            return(bom);
        }
Ejemplo n.º 2
0
        internal static List <string> GetCellCodeList(string productID, CellActionType actionType = CellActionType.None)
        {
            List <string> list = new List <string>();

            var cellBoms = GetCellBomAtFrom(productID, actionType);

            if (cellBoms == null || cellBoms.Count == 0)
            {
                return(list);
            }

            foreach (var cellBom in cellBoms)
            {
                string cellCode = cellBom.CellCode;

                if (string.IsNullOrEmpty(cellCode))
                {
                    continue;
                }

                if (list.Contains(cellCode) == false)
                {
                    list.AddSort(cellCode);
                }
            }

            return(list);
        }
Ejemplo n.º 3
0
        public void CellAction(int row, int col, CellActionType action)
        {
            Cell cell;

            if (mineField.TryGetValue(new Coordinates(row, col), out cell))
            {
                if (action == CellActionType.Open && cell.CellType == CellType.Closed)
                {
                    OpenCell(cell);
                }
                else
                {
                    if (action == CellActionType.NextMarker)
                    {
                        NextMarker(cell);
                    }
                    else
                    {
                        return;
                    }
                }
                OnModelUpdated();
                CheckGameOver();
            }
        }
Ejemplo n.º 4
0
        internal static string GetCellCode(string productID, string productVer, CellActionType actionType)
        {
            CellBom bom = FindCellBomAtFrom(productID, productVer, actionType);

            if (bom == null)
            {
                return(productID);
            }

            return(bom.CellCode);
        }
Ejemplo n.º 5
0
        internal static List <CellBom> GetCellBomByCellCode(string cellCode, CellActionType actionType)
        {
            if (string.IsNullOrEmpty(cellCode))
            {
                return(null);
            }

            List <CellBom> list;

            _maps.TryGetValue(cellCode, actionType, out list);

            return(list);
        }
Ejemplo n.º 6
0
        //Перевод действия при установке ссылки по шаблону в строку
        public static string ToRussian(this CellActionType t)
        {
            switch (t)
            {
            case CellActionType.Link:
                return("Установить ссылку");

            case CellActionType.Value:
                return("Записать значение");

            case CellActionType.Save:
                return("Cсылка на сохранение");

            case CellActionType.Text:
                return("Записать текст");
            }
            return("Установить ссылку");
        }
Ejemplo n.º 7
0
        private static List <CellBom> GetCellBomAtFrom(string productID, CellActionType actionType)
        {
            List <CellBom> list = new List <CellBom>();

            if (string.IsNullOrEmpty(productID))
            {
                return(list);
            }

            if (actionType == CellActionType.None)
            {
                foreach (var bomList in _fromListByType.Values)
                {
                    foreach (var bom in bomList)
                    {
                        //2019.10.29 From(Array/CF) 기준에선 ShopID 체크 X
                        //if (bom.FromShopID != shopID)
                        //    continue;

                        if (bom.FromProductID != productID)
                        {
                            continue;
                        }

                        list.Add(bom);
                    }
                }
            }
            else
            {
                string key = GetFromListKey(productID, actionType);
                _fromListByType.TryGetValue(key, out list);
            }

            return(list);
        }
Ejemplo n.º 8
0
 private static string GetFromListKey(string productID, CellActionType actionType)
 {
     return(LcdHelper.CreateKey(productID, actionType.ToString()));
 }
Ejemplo n.º 9
0
 public CellActionArgs(int row, int col, CellActionType cellActionType)
 {
     Row            = row;
     Col            = col;
     CellActionType = cellActionType;
 }