コード例 #1
0
    //TODO: Good target to move into subphase class
    public bool TryConfirmPosition(Ship.GenericShip ship)
    {
        bool result = true;

        //TODO:
        //Cannot leave board
        //Obstacles

        if (Phases.CurrentSubPhase.GetType() == typeof(SubPhases.SetupSubPhase))
        {
            if (!ship.IsInside(StartingZone))

            {
                Messages.ShowErrorToHuman("Place ship into highlighted area");
                result = false;
            }

            if (Game.Movement.CollidedWith != null)
            {
                Messages.ShowErrorToHuman("This ship shouldn't collide with another ships");
                result = false;
            }
        }

        //TODO: Different for setup and Barrel Roll
        if (result)
        {
            StopDrag();
        }

        return(result);
    }