/// <summary>
        /// Processes the specified information point
        /// </summary>
        /// <param name="info">The information on cell content</param>
        public virtual void Assign(CellContentInfo info)
        {
            var             types = info.type.getEnumListFromFlags <CellContentType>();
            CellContentType t     = info.type;


            foreach (CellContentType mt in measuredTypes)
            {
                if (t.HasFlag(mt))
                {
                    cellContentTypeCounter.Count(mt);
                    break;
                }
            }

            cellContentRealTypeCounter.Count(t);

            if (cellContentTypeCounter.DistinctCount() > 0)
            {
                dominantType = cellContentTypeCounter.GetItemsWithTopFrequency().FirstOrDefault();
            }
            results.Add(t);
            results_real.Add(info.type);

            //frequency[t]++;

            min_width = Math.Min(min_width, info.length);
            max_width = Math.Max(max_width, info.length);
        }
Ejemplo n.º 2
0
 public CellContentInfo(Coordinates coordinates, byte healthCount, CellContentType type, string userId)
 {
     this.Coordinates = coordinates;
     this.HealthCount = healthCount;
     this.Type        = type;
     this.UserId      = userId;
 }
Ejemplo n.º 3
0
        public void Clear()
        {
            if (content != CellContentType.WALL)
            {
                content = CellContentType.EMPTY;
            }

            return;
        }
Ejemplo n.º 4
0
        public bool SetContent(CellContentType newContent)
        {
            if (content == CellContentType.EMPTY)
            {
                content = newContent;
                return(true);
            }

            return(false);
        }
        /// <summary>
        /// Performs a test on
        /// </summary>
        /// <param name="sourceTable">The source table.</param>
        /// <param name="type">The type.</param>
        /// <param name="i">The i.</param>
        /// <returns></returns>
        public SourceTableSliceTest MakeSliceTest(SourceTable sourceTable, SourceTableSliceType type, Int32 i = 0)
        {
            SourceTableSliceTest output = new SourceTableSliceTest()
            {
                format = type
            };

            switch (type)
            {
            case SourceTableSliceType.row:
                output.Values = sourceTable.GetRow(i);
                break;

            default:
            case SourceTableSliceType.column:
                output.Values = sourceTable.GetColumn(i);
                break;
            }

            CellContentType contentType    = CellContentType.unknown;
            List <String>   DistinctValues = new List <string>();

            foreach (var v in output.Values)
            {
                CellContentInfo t = sourceContentAnalysis.DetermineContentType(v);
                if (contentType == CellContentType.unknown)
                {
                    contentType = t.type;
                }
                else if (contentType != t.type)
                {
                    if (!t.type.HasFlag(contentType))
                    {
                        output.IsUniformFormat = false;
                    }
                }

                if (v.IsNullOrEmpty())
                {
                    output.IsNoEmptyValue = false;
                }
                if (!DistinctValues.Contains(v))
                {
                    DistinctValues.Add(v);
                }
            }
            if (DistinctValues.Count < output.Values.Count)
            {
                output.IsDistinctValue = false;
            }
            return(output);
        }
Ejemplo n.º 6
0
 public SpreadsheetCellModel(int row, int column, CellContentType contentType, int formatId, [NotNull] ICellFormatsProvider formatProvider, double value, string text)
 {
     if (formatProvider == null)
     {
         throw new ArgumentException("formatProvider is null");
     }
     this.row            = row;
     this.column         = column;
     this.contentType    = contentType;
     this.formatId       = formatId;
     this.formatProvider = formatProvider;
     this.value          = value;
     this.text           = text;
 }
Ejemplo n.º 7
0
 private void ChangeCellSprite(int indexPosition, CellContentType contentType) => cellRenderers[indexPosition].sprite = CellSpriteInitializator.GetSprite(contentType);
 public static Sprite GetSprite(CellContentType contentType) => spriteCollection[(int)contentType];
Ejemplo n.º 9
0
        //private Bot bot;


        public Cell(int x, int y)
        {
            point   = new MPoint(x, y);
            content = CellContentType.EMPTY;
            //bot = null;
        }