Esempio n. 1
0
    protected override void OnUpdate()
    {
        EntityQuery eq = GetEntityQuery(ComponentType.ReadOnly <ClickPoint>());

        var ecb = ess.CreateCommandBuffer();

        using (var clickPoints = eq.ToComponentDataArray <ClickPoint>(Allocator.TempJob))
        {
            if (clickPoints.Length == 0)
            {
                return;
            }

            ClickPoint click      = clickPoints[0];
            int2       clickIndex = SpawnerMono.PositionToIndex(click.position);

            Entities.ForEach((Entity e, in JewelCell cell) =>
            {
                if (cell.x == clickIndex.x && cell.y == clickIndex.y)
                {
                    ecb.AddComponent(e, new JewelSelected());
                }
            }).Run();
        }
    }
Esempio n. 2
0
 public void Played(ClickPoint point)
 {
     firstTurn = false;
     usedPoint.Add(new Vector2(point.transform.position.x, point.transform.position.z), point);
     map[Convert.ToInt32(point.transform.position.x)][Convert.ToInt32(point.transform.position.z)] = (Cases)Convert.ToInt32(playTurn);
     CheckCapture(Convert.ToInt32(point.transform.position.x), Convert.ToInt32(point.transform.position.z), (Cases)Convert.ToInt32(playTurn));
     CheckWin(Convert.ToInt32(point.transform.position.x), Convert.ToInt32(point.transform.position.z), (Cases)Convert.ToInt32(playTurn));
     playTurn = !playTurn;
 }
Esempio n. 3
0
 private void AddCustomerSkill(ClickPoint cb, CustomSkill skill)
 {
     if (cb != null)
     {
         var addindex = cb.battler.timeline.FindIndex(n => n == cb.skill);
         if (0 <= addindex)
         {
             cb.battler.timeline.Insert(addindex + 1, skill);
         }
     }
 }
Esempio n. 4
0
        /// <summary>
        /// A cursor, since XNA doesn't draw one.
        /// Bryan Patzke, 2008
        /// </summary>
        /// <param name="cursorImage">The resource keu for the cursor image.</param>
        /// <param name="Position">The corner of the pointer that represents the cursor's hotspot.</param>
        /// <returns></returns>
        public Cursor(string cursorImage, ClickPoint cursorPosition)
            : base()
        {
            mCursorImage = ResourceGetTexture2D(cursorImage);
            ClickPosition = cursorPosition;
            mSpriteBatch = new SpriteBatch(theGame.Graphics.GraphicsDevice);
            mSourceRect = new Rectangle(0, 0, mCursorImage.Width, mCursorImage.Height);
            ObjectDepth = int.MinValue;

            // turn off normal cursor visibility
            theScene.MouseVisibility(false);
        }
Esempio n. 5
0
        private void TimelineForm_MouseClick(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Right)
            {
                System.Drawing.Point p = System.Windows.Forms.Cursor.Position;

                clickpoint = clickablepoint.Find(n => n.rect.Contains(e.Location));

                if (clickpoint != null)
                {
                    resetToolStripMenuItem.Enabled      = clickpoint.skill.darty;
                    deleteDataToolStripMenuItem.Enabled = Deleteable(clickpoint.skill);

                    //指定した画面上の座標位置にコンテキストメニューを表示する
                    this.contextMenuStrip1.Show(p);
                }
            }
        }
Esempio n. 6
0
        public AddEditForm(ClickPoint item, bool isEditMode = false)
        {
            InitializeComponent();

            ApplyConfig();

            if (isEditMode)
            {
                tbName.Text = item.Name;
            }
            else
            {
                tbName.Text = String.Format(
                    "Point {0}-{1}", DateTime.Now.ToShortDateString(), DateTime.Now.ToShortTimeString());
            }
            nudX.Value = item.X;
            nudY.Value = item.Y;
        }
Esempio n. 7
0
 public bool isPlayable(ClickPoint point)
 {
     if (finish == true)
     {
         return(false);
     }
     if (firstTurn == true && (point.transform.position.x != 9 || point.transform.position.z != 9))
     {
         gameUI.UpdateRulesText("First player must play at the middle");
         Invoke("ClearRules", 5f);
         return(false);
     }
     if (CheckDouble((int)point.transform.position.x, (int)point.transform.position.z, (Cases)Convert.ToInt32(playTurn)) == true)
     {
         gameUI.UpdateRulesText("Double-Three are forbidden");
         Invoke("ClearRules", 5f);
         return(false);
     }
     return(true);
 }
Esempio n. 8
0
 private void Update()
 {
     ClickPoint.Update();
 }
Esempio n. 9
0
 public void Execute()
 {
     ClickPoint.Update();
     KeyView.Update();
 }
Esempio n. 10
0
 public void Played(ClickPoint point)
 {
     firstTurn = false;
     usedPoint.Add(new Vector2(point.transform.position.x, point.transform.position.z), point);
     map[Convert.ToInt32(point.transform.position.x)][Convert.ToInt32(point.transform.position.z)] = (Cases)Convert.ToInt32(playTurn);
     CheckCapture(Convert.ToInt32(point.transform.position.x), Convert.ToInt32(point.transform.position.z), (Cases)Convert.ToInt32(playTurn));
     CheckWin(Convert.ToInt32(point.transform.position.x), Convert.ToInt32(point.transform.position.z), (Cases)Convert.ToInt32(playTurn));
     playTurn = !playTurn;
 }
Esempio n. 11
0
 public bool isPlayable(ClickPoint point)
 {
     if (finish == true)
         return false;
     if (firstTurn == true && (point.transform.position.x != 9 || point.transform.position.z != 9))
     {
         gameUI.UpdateRulesText("First player must play at the middle");
         Invoke("ClearRules", 5f);
         return false;
     }
     if (CheckDouble((int)point.transform.position.x, (int)point.transform.position.z, (Cases)Convert.ToInt32(playTurn)) == true)
     {
         gameUI.UpdateRulesText("Double-Three are forbidden");
         Invoke("ClearRules", 5f);
         return false;
     }
     return true;
 }