Exemplo n.º 1
0
        public void calculateArray(int x , int y )
        {
            cells = new ObjectCell[10, 10];
            for (int i = 0; i < 10; i++ ) {
                for (int j = 0; j < 10; j++ ) {
                    cells[i, j] = new ObjectCell();
                }
            }
            for (int i = 0; i < gameEngine.StoneWalls.Count; i++ ) {
                int xPoint = gameEngine.StoneWalls[i].PositionX;
                int yPoint = gameEngine.StoneWalls[i].PositionY;
                cells[xPoint, yPoint].category = "S";
            }
            for (int i = 0; i < gameEngine.BrickWalls.Count; i++)
            {
                int xPoint = gameEngine.BrickWalls[i].PositionX;
                int yPoint = gameEngine.BrickWalls[i].PositionY;
                cells[xPoint, yPoint].category = "B";
            }
            for (int i = 0; i < gameEngine.Water.Count; i++)
            {
                int xPoint = gameEngine.Water[i].PositionX;
                int yPoint = gameEngine.Water[i].PositionY;
                cells[xPoint, yPoint].category = "W";
            }
            cells[x, y].count = 0;
            cells[x, y].direction= ownedTank.Direction;
            cells[x, y].predesessor = null;
            cells[x, y].state= "S";

            fillArray(x,y);
        }
        private CellsAppearance GetAppearance(LeftTableColumnValue column, ObjectCell cell = null)
        {
            Appearance appearance = null;

            if (column != null)
            {
                appearance           = column.Appearances ?? new Appearance();
                appearance.TextAlign = appearance.TextAlign ?? "flex-start";

                if (column.Options?.GetValueOrDefault("currency") is long currency)
                {
                    appearance.UseCurrencySymbol     = true;
                    appearance.CurrencySymbol        = (int)currency;
                    appearance.FloatingPointAccuracy = 2;
                }
            }

            var cellAppearance = AppearanceHelper.GetAppearance(cell?.Appearance, appearance);

            return(cellAppearance);
        }