Ejemplo n.º 1
0
        public override bool TouchesEnded(Microsoft.Xna.Framework.Input.MouseState touch, Point point)
        {
            if (!Istouch)
                return base.TouchesEnded(touch, point);
            if (MainGameScene.ShardMainGame().InDayOrNightSprite(point))
            {
                return base.TouchesEnded(touch, point);
            }
            if (_box != null)
            {
                var vector = IntVector.ToGridIntVector(new Vector2(point.X,point.Y));
                if (vector.X < 0 || vector.X > GameConfig.WidthX - 1 || vector.Y < 0 || vector.Y > GameConfig.HightY - 1)
                {
                    _box.MouseCancel();
                }
                else
                {
                    _box.MouseEnd();
                    Card.CardShowLayer.SharedCardShow().RemoveChild(_box);
                    for (int i = 0; i < Card.CardShowLayer.SharedCardShow().Boxs.Count; i++)
                    {
                        CardBox cardBox = Card.CardShowLayer.SharedCardShow().Boxs[i];
                        cardBox.SetPoint(i);
                    }
                    //todo: xx
                    Paper paper = new Paper();
                    switch (_box.Id)
                    {
                        case 1:
                            paper = new RandomWirePaper();
                            break;
                        case 2:
                            paper = new IcePaper();
                            break;
                        case 3:
                            paper = new RocketPaper();
                            break;
                        case 4:
                            paper = new XWirePaper();
                            break;
                        case 5:
                            paper = new BombPaper();
                            break;
                        case 6:
                            paper = new BigIcePaper();
                            break;
                        case 7:
                            paper = new BigBombPaper();
                            break;
                        case 8:
                            paper = new HorizontalPaper();
                            break;
                    }
                    paper.SetVector(vector.X, vector.Y);
                    CardShowLayer.SharedCardShow().AddChild(paper);

                }

            }
            _box = null;
            return base.TouchesEnded(touch, point);
        }
Ejemplo n.º 2
0
 public void AddChild(Paper paper)
 {
     AddChild(paper.Sprite);
     Papers.Add(paper);
 }