Exemple #1
0
    public static bool PlaceBombAt(int x, int y, Pawn owner)
    {
        // check that no bomb has already been placed here
        foreach (var other in m_bombs)
        {
            if (other.GetMapX() == x && other.GetMapY() == y)
            {
                return(false);
            }
        }

        // create and configure new bomb
        var bomb = m_root.CreateBomb(x, y);

        bomb.SetOwner(owner);
        bomb.SetRange(owner.BombRange);

        m_bombs.Add(bomb);
        BombPlaced?.Invoke(bomb, owner);
        return(true);
    }