Example #1
0
 public BallInfo(int posX, int posY)
 {
     _Pos        = new Vector2(posX, posY);
     _BallType   = BallType.None;
     _BallSPType = BallType.None;
     _BallInfoSP = null;
 }
Example #2
0
    public bool ExChangeBall(BallInfo other)
    {
        if (!IsCanExChange(other))
        {
            return(false);
        }

        var temp = other.BallType;

        other.BallType = _BallType;
        _BallType      = temp;

        var tempRound = other.BornRound;

        other.BornRound = BornRound;
        BornRound       = tempRound;

        if (_BallInfoSP != null && _BallInfoSP.IsExchangeSpInfo(other))
        {
            var tempSP = other._BallInfoSP;
            other._BallInfoSP = _BallInfoSP;
            _BallInfoSP       = tempSP;


            var tempSpType = other.BallSPType;
            other.BallSPType = BallSPType;
            BallSPType       = tempSpType;

            if (_BallInfoSP != null)
            {
                _BallInfoSP.SetBallInfo(this);
            }
            other._BallInfoSP.SetBallInfo(other);
        }
        else if (other._BallInfoSP != null && other._BallInfoSP.IsExchangeSpInfo(this))
        {
            var tempSP = other._BallInfoSP;
            other._BallInfoSP = _BallInfoSP;
            _BallInfoSP       = tempSP;
            _BallInfoSP.SetBallInfo(other);

            var tempSpType = other.BallSPType;
            other.BallSPType = BallSPType;
            BallSPType       = tempSpType;

            _BallInfoSP.SetBallInfo(this);
            if (other._BallInfoSP != null)
            {
                other._BallInfoSP.SetBallInfo(other);
            }
        }

        return(true);
    }
Example #3
0
    public void SetInterSP(string interInfo)
    {
        var spArgs = interInfo.Trim('(', ')').Split(';');

        int spType = int.Parse(spArgs[0]);

        if (!BallBox.IsTypeSP(spType))
        {
            _BallType = (BallType)spType;
            SetBallType(_BallType);
        }
        else
        {
            BallType       initType = (BallType)spType;
            BallInfoSPBase initBall = GetBallInfoSP(initType, spArgs);

            _IncludeBallInfoSP = initBall;
            _IncludeBallSPType = initType;
        }
    }
Example #4
0
    public void ClearSP()
    {
        if (IsBombBall())
        {
            ++BallBox.Instance._ElimitBombCnt;
        }

        if (_BallInfoSP is BallInfoSPLineReact)
        {
            BallInfoSPLineReact.RemoveReactBall(_BallInfoSP as BallInfoSPLineReact);
        }

        if (_BallInfoSP is BallInfoSPBombAuto)
        {
            BallInfoSPBombAuto.AutoBombList.Remove(_BallInfoSP as BallInfoSPBombAuto);
        }



        _BallSPType = BallType.None;
        _BallInfoSP = null;
    }
Example #5
0
    public void SpRemove()
    {
        if (_IncludeBallInfoSP != null)
        {
            if (_IncludeBallSPType > BallType.SPTrapStart && _IncludeBallSPType < BallType.SPTrapEnd)
            {
                ++BallBox.Instance._ElimitTrapCnt;
            }

            _BallInfoSP = _IncludeBallInfoSP;
            _BallSPType = _IncludeBallSPType;

            if (_IncludeBallInfoSP is BallInfoSPTrapPosion)
            {
                BallInfoSPTrapPosion._TrapPosionList.Remove(_IncludeBallInfoSP as BallInfoSPTrapPosion);
            }

            _IncludeBallInfoSP = null;
            _IncludeBallSPType = BallType.None;



            return;
        }

        if (_BallSPType > BallType.SPTrapStart && _BallSPType < BallType.SPTrapEnd)
        {
            ++BallBox.Instance._ElimitTrapCnt;
        }

        if (_BallInfoSP is BallInfoSPTrapPosion)
        {
            BallInfoSPTrapPosion._TrapPosionList.Remove(_BallInfoSP as BallInfoSPTrapPosion);
        }

        _BallInfoSP = null;
        _BallSPType = BallType.None;
    }
Example #6
0
    public void SetBallInitType(string ballSPType)
    {
        var spArgs = ballSPType.Split(',');

        if (spArgs.Length < 1)
        {
            return;
        }

        int spType = int.Parse(spArgs[0]);

        if (!BallBox.IsTypeSP(spType))
        {
            _BallType = (BallType)spType;
            SetBallType(_BallType);
        }
        else
        {
            BallType       initType = (BallType)spType;
            BallInfoSPBase initBall = GetBallInfoSP(initType, spArgs);

            if (_BallInfoSP != null)
            {
                if (_BallInfoSP.IsCanBeContentSP() && initBall.IsCanContentSP())
                {
                    _IncludeBallSPType = _BallSPType;
                    _IncludeBallInfoSP = _BallInfoSP;
                }
            }

            _BallInfoSP = initBall;
            _BallSPType = initType;
            if (!_BallInfoSP.IsContentNormal())
            {
                SetBallType(BallType.None);
            }
        }
    }
Example #7
0
    private BallInfoSPBase GetBallInfoSP(BallType ballType, string[] spArgs)
    {
        BallInfoSPBase initBall = null;

        switch (ballType)
        {
        case BallType.Ice:
            initBall = new BallInfoSPTrapIce();
            initBall.SetBallInfo(this);
            initBall.SetParam(spArgs);
            break;

        case BallType.Clod:
            initBall = new BallInfoSPTrapClod();
            initBall.SetBallInfo(this);
            initBall.SetParam(spArgs);
            break;

        case BallType.Stone:
            initBall = new BallInfoSPTrapStone();
            initBall.SetBallInfo(this);
            initBall.SetParam(spArgs);
            break;

        case BallType.Posion:
            initBall = new BallInfoSPTrapPosion();
            initBall.SetBallInfo(this);
            initBall.SetParam(spArgs);
            break;

        case BallType.Iron:
            initBall = new BallInfoSPTrapIron();
            initBall.SetBallInfo(this);
            initBall.SetParam(spArgs);
            break;

        case BallType.BombSmall1:
            initBall = new BallInfoSPBombSmall();
            initBall.SetBallInfo(this);
            initBall.SetParam(spArgs);
            break;

        case BallType.BombBig1:
            initBall = new BallInfoSPBombBig();
            initBall.SetBallInfo(this);
            initBall.SetParam(spArgs);
            break;

        case BallType.BombSmallEnlarge1:
            initBall = new BallInfoSPBombSmallEnlarge();
            initBall.SetBallInfo(this);
            initBall.SetParam(spArgs);
            break;

        case BallType.BombBigEnlarge:
            initBall = new BallInfoSPBombBigEnlarge();
            initBall.SetBallInfo(this);
            initBall.SetParam(spArgs);
            break;

        case BallType.BombSmallHitTrap:
            initBall = new BallInfoSPBombSmallTrap();
            initBall.SetBallInfo(this);
            initBall.SetParam(spArgs);
            break;

        case BallType.BombBigHitTrap:
            initBall = new BallInfoSPBombBigTrap();
            initBall.SetBallInfo(this);
            initBall.SetParam(spArgs);
            break;

        case BallType.BombSmallReact:
            initBall = new BallInfoSPBombSmallReact();
            initBall.SetBallInfo(this);
            initBall.SetParam(spArgs);
            break;

        case BallType.BombBigReact:
            initBall = new BallInfoSPBombBigReact();
            initBall.SetBallInfo(this);
            initBall.SetParam(spArgs);
            break;

        case BallType.BombSmallLighting:
            initBall = new BallInfoSPBombSmallLighting();
            initBall.SetBallInfo(this);
            initBall.SetParam(spArgs);
            break;

        case BallType.BombBigLighting:
            initBall = new BallInfoSPBombBigLighting();
            initBall.SetBallInfo(this);
            initBall.SetParam(spArgs);
            break;

        case BallType.BombSmallAuto:
            initBall = new BallInfoSPBombSmallAuto();
            initBall.SetBallInfo(this);
            initBall.SetParam(spArgs);
            break;

        case BallType.BombBigAuto:
            initBall = new BallInfoSPBombBigAuto();
            initBall.SetBallInfo(this);
            initBall.SetParam(spArgs);
            break;

        case BallType.LineRow:
            initBall = new BallInfoSPLineRow();
            initBall.SetBallInfo(this);
            initBall.SetParam(spArgs);
            break;

        case BallType.LineClumn:
            initBall = new BallInfoSPLineClumn();
            initBall.SetBallInfo(this);
            initBall.SetParam(spArgs);
            break;

        case BallType.LineCross:
            initBall = new BallInfoSPLineCross();
            initBall.SetBallInfo(this);
            initBall.SetParam(spArgs);
            break;

        case BallType.LineRowEnlarge:
            initBall = new BallInfoSPLineRowEnlarge();
            initBall.SetBallInfo(this);
            initBall.SetParam(spArgs);
            break;

        case BallType.LineClumnEnlarge:
            initBall = new BallInfoSPLineClumnEnlarge();
            initBall.SetBallInfo(this);
            initBall.SetParam(spArgs);
            break;

        case BallType.LineCrossEnlarge:
            initBall = new BallInfoSPLineCrossEnlarge();
            initBall.SetBallInfo(this);
            initBall.SetParam(spArgs);
            break;

        case BallType.LineRowHitTrap:
            initBall = new BallInfoSPLineRowTrap();
            initBall.SetBallInfo(this);
            initBall.SetParam(spArgs);
            break;

        case BallType.LineClumnHitTrap:
            initBall = new BallInfoSPLineClumnTrap();
            initBall.SetBallInfo(this);
            initBall.SetParam(spArgs);
            break;

        case BallType.LineCrossHitTrap:
            initBall = new BallInfoSPLineCrossTrap();
            initBall.SetBallInfo(this);
            initBall.SetParam(spArgs);
            break;

        case BallType.LineRowReact:
            initBall = new BallInfoSPLineRowReact();
            initBall.SetBallInfo(this);
            initBall.SetParam(spArgs);
            break;

        case BallType.LineClumnReact:
            initBall = new BallInfoSPLineClumnReact();
            initBall.SetBallInfo(this);
            initBall.SetParam(spArgs);
            break;

        case BallType.LineCrossReact:
            initBall = new BallInfoSPLineCrossReact();
            initBall.SetBallInfo(this);
            initBall.SetParam(spArgs);
            break;

        case BallType.LineRowLighting:
            initBall = new BallInfoSPLineRowLighting();
            initBall.SetBallInfo(this);
            initBall.SetParam(spArgs);
            break;

        case BallType.LineClumnLighting:
            initBall = new BallInfoSPLineClumnLighting();
            initBall.SetBallInfo(this);
            initBall.SetParam(spArgs);
            break;

        case BallType.LineCrossLighting:
            initBall = new BallInfoSPLineCrossLighting();
            initBall.SetBallInfo(this);
            initBall.SetParam(spArgs);
            break;

        case BallType.LineRowAuto:
            initBall = new BallInfoSPLineRowAuto();
            initBall.SetBallInfo(this);
            initBall.SetParam(spArgs);
            break;

        case BallType.LineClumnAuto:
            initBall = new BallInfoSPLineClumnAuto();
            initBall.SetBallInfo(this);
            initBall.SetParam(spArgs);
            break;

        case BallType.LineCrossAuto:
            initBall = new BallInfoSPLineCrossAuto();
            initBall.SetBallInfo(this);
            initBall.SetParam(spArgs);
            break;

        case BallType.RPGHP:
            initBall = new BallInfoSPRPGHP();
            initBall.SetBallInfo(this);
            initBall.SetParam(spArgs);
            break;
        }

        return(initBall);
    }