Пример #1
0
        private void Initialize()
        {
            mMode = ArrangementMode.UpperCase;

            mUpperCaseArrangement = new Arrangement(mLowerCaseArrangement.GetLayoutString().ToUpper().Replace('«', 'ʬ'));

            // The DisplayMetrics method uses the size of the full screen, but we need to adjust for the notification bar so we instead set the size in OnSizeChanged. Width and Height aren't available in Initialize()
            //DisplayMetrics dm = Resources.DisplayMetrics;
            //mViewInfo = new ViewInfo(dm.WidthPixels, dm.HeightPixels);


            sSignatureLocations = new Dictionary <KeyValuePair <int, int>, Signature>();
            // Top
            sSignatureLocations.Add(new KeyValuePair <int, int>(1, 0), new Signature(2, Direction.Clockwise, 1));
            sSignatureLocations.Add(new KeyValuePair <int, int>(2, 0), new Signature(2, Direction.Clockwise, 2));
            sSignatureLocations.Add(new KeyValuePair <int, int>(3, 0), new Signature(2, Direction.Clockwise, 3));
            sSignatureLocations.Add(new KeyValuePair <int, int>(4, 0), new Signature(2, Direction.Clockwise, 4));
            sSignatureLocations.Add(new KeyValuePair <int, int>(6, 0), new Signature(1, Direction.CounterClockwise, 4));
            sSignatureLocations.Add(new KeyValuePair <int, int>(7, 0), new Signature(1, Direction.CounterClockwise, 3));
            sSignatureLocations.Add(new KeyValuePair <int, int>(8, 0), new Signature(1, Direction.CounterClockwise, 2));
            sSignatureLocations.Add(new KeyValuePair <int, int>(9, 0), new Signature(1, Direction.CounterClockwise, 1));

            //Bottom
            sSignatureLocations.Add(new KeyValuePair <int, int>(1, 10), new Signature(3, Direction.CounterClockwise, 1));
            sSignatureLocations.Add(new KeyValuePair <int, int>(2, 10), new Signature(3, Direction.CounterClockwise, 2));
            sSignatureLocations.Add(new KeyValuePair <int, int>(3, 10), new Signature(3, Direction.CounterClockwise, 3));
            sSignatureLocations.Add(new KeyValuePair <int, int>(4, 10), new Signature(3, Direction.CounterClockwise, 4));
            sSignatureLocations.Add(new KeyValuePair <int, int>(6, 10), new Signature(4, Direction.Clockwise, 4));
            sSignatureLocations.Add(new KeyValuePair <int, int>(7, 10), new Signature(4, Direction.Clockwise, 3));
            sSignatureLocations.Add(new KeyValuePair <int, int>(8, 10), new Signature(4, Direction.Clockwise, 2));
            sSignatureLocations.Add(new KeyValuePair <int, int>(9, 10), new Signature(4, Direction.Clockwise, 1));

            // Left
            sSignatureLocations.Add(new KeyValuePair <int, int>(0, 1), new Signature(2, Direction.CounterClockwise, 1));
            sSignatureLocations.Add(new KeyValuePair <int, int>(0, 2), new Signature(2, Direction.CounterClockwise, 2));
            sSignatureLocations.Add(new KeyValuePair <int, int>(0, 3), new Signature(2, Direction.CounterClockwise, 3));
            sSignatureLocations.Add(new KeyValuePair <int, int>(0, 4), new Signature(2, Direction.CounterClockwise, 4));
            sSignatureLocations.Add(new KeyValuePair <int, int>(0, 6), new Signature(3, Direction.Clockwise, 4));
            sSignatureLocations.Add(new KeyValuePair <int, int>(0, 7), new Signature(3, Direction.Clockwise, 3));
            sSignatureLocations.Add(new KeyValuePair <int, int>(0, 8), new Signature(3, Direction.Clockwise, 2));
            sSignatureLocations.Add(new KeyValuePair <int, int>(0, 9), new Signature(3, Direction.Clockwise, 1));

            // Right
            sSignatureLocations.Add(new KeyValuePair <int, int>(10, 1), new Signature(1, Direction.Clockwise, 1));
            sSignatureLocations.Add(new KeyValuePair <int, int>(10, 2), new Signature(1, Direction.Clockwise, 2));
            sSignatureLocations.Add(new KeyValuePair <int, int>(10, 3), new Signature(1, Direction.Clockwise, 3));
            sSignatureLocations.Add(new KeyValuePair <int, int>(10, 4), new Signature(1, Direction.Clockwise, 4));
            sSignatureLocations.Add(new KeyValuePair <int, int>(10, 6), new Signature(4, Direction.CounterClockwise, 4));
            sSignatureLocations.Add(new KeyValuePair <int, int>(10, 7), new Signature(4, Direction.CounterClockwise, 3));
            sSignatureLocations.Add(new KeyValuePair <int, int>(10, 8), new Signature(4, Direction.CounterClockwise, 2));
            sSignatureLocations.Add(new KeyValuePair <int, int>(10, 9), new Signature(4, Direction.CounterClockwise, 1));

            // Corners
            sSignatureLocations.Add(new KeyValuePair <int, int>(0, 0), Signature.TopLeft);
            sSignatureLocations.Add(new KeyValuePair <int, int>(10, 0), Signature.TopRight);
            sSignatureLocations.Add(new KeyValuePair <int, int>(0, 10), Signature.BottomLeft);
            sSignatureLocations.Add(new KeyValuePair <int, int>(10, 10), Signature.BottomRight);

            this.SetOnTouchListener(this);
        }
Пример #2
0
 private void SetRowArrangementMode()
 {
     arrangementMode = ArrangementMode.Row;
     Piet.Dispatcher.arrangementMode = arrangementMode;
     rowsImage.Source             = new BitmapImage(new Uri("/resources/Rows_Selected.png", UriKind.Relative));
     rowsImageLabel.Foreground    = System.Windows.Application.Current.FindResource("ColumnsRowsSelectedTextColor") as SolidColorBrush;
     columnsImage.Source          = new BitmapImage(new Uri("/resources/Columns_Deselected.png", UriKind.Relative));
     columnsImageLabel.Foreground = System.Windows.Application.Current.FindResource("ColumnsRowsDeselectedTextColor") as SolidColorBrush;
 }
Пример #3
0
 public Lane(int x, int y, Measure laneMaxMeasure, int offsetSize, ArrangementMode arrangementMode, int cornerRadius, HandlingType handlingType)
 {
     this.x = x;
     this.y = y;
     this.laneMaxMeasure  = laneMaxMeasure;
     this.offsetSize      = offsetSize;
     this.arrangementMode = arrangementMode;
     this.cornerRadius    = cornerRadius;
     this.handlingType    = handlingType;
 }
Пример #4
0
 // Constructor ------
 public Stage(int bLim   = 10, int bHP = 3, Weapons bWp = Weapons.Missile,
              bool isAct = true, ArrangementMode bArr = ArrangementMode.Manual, int tLim = 30, int sLim = 100,
              ClearCondition condition = ClearCondition.None) // 互換性のために一旦おいておくけど本当は消したい!!また今度やる
 {
     BalloonLimit           = bLim;
     BalloonHP              = bHP;
     BalloonWeaponKey       = bWp;
     IsBalloonAction        = isAct;
     BalloonArrangementMode = bArr;
     TimeLimit              = tLim;
     ShootingLimit          = sLim;
     GameClearCondition     = condition;
 }
Пример #5
0
 public Grid(int lanesNum, ArrangementMode arrangementMode, HandlingType handlingType, List <String> imageFilePaths, int offsetSize, int[] offsetColor, int cornerRadius)
 {
     this.lanesNum         = lanesNum;
     this.arrangementMode  = arrangementMode;
     this.imageFilePaths   = imageFilePaths;
     this.offsetSize       = offsetSize;
     this.offsetColor      = offsetColor;
     this.handlingType     = handlingType;
     this.cornerRadius     = cornerRadius;
     (maxWidth, maxHeight) = GetMaxScreenSize();
     this.laneMaxMeasure   = arrangementMode == ArrangementMode.Column
         ? new Measure((maxWidth - (lanesNum + 1) * offsetSize) / lanesNum, maxHeight)
         : new Measure(maxWidth, (maxHeight - (lanesNum + 1) * offsetSize) / lanesNum);
     lanes = InitializeLanes();
     imageFilePaths.Shuffle();
 }
Пример #6
0
        private void SetSettingsValues()
        {
            columnsRowsNum = Properties.Settings.Default.columnsRowsNum;
            columnsRowsNumBox.SetValue(columnsRowsNum);

            var arrangementModeSettings = Properties.Settings.Default.arrangementMode;

            arrangementMode = Enum.IsDefined(typeof(ArrangementMode), arrangementModeSettings)
                ? (ArrangementMode)arrangementModeSettings
                : ArrangementMode.Column;
            if (arrangementMode == ArrangementMode.Column)
            {
                SetColumsArrangementMode();
            }
            else
            {
                SetRowArrangementMode();
            }

            folderPath     = Properties.Settings.Default.folderPath;
            folderBox.Text = folderPath;

            if (App.isRunning)
            {
                SetStartWorkingBtn();
            }
            else
            {
                SetStartInitialBtn();
            }

            if (App.isRunning)
            {
                DisableFolderBtnBox();
            }

            refreshTime = Properties.Settings.Default.refreshTime;
            refreshTimeBox.SetValue(refreshTime);
        }