Пример #1
0
        /// <summary>
        /// <para>Iterate over a NodeList, return true if any of the provided iterate
        /// function calls returns true, false otherwise.</para>
        /// <para>For convenience, the current object context is applied to the
        /// provided iterate function.</para>
        /// </summary>
        /// <param name="nodeList">The nodes to operate on</param>
        /// <param name="fn">The iterate function</param>
        /// <returns>bool</returns>
        internal static bool SomeNode(INodeList nodeList, Func <INode, bool> fn)
        {
            if (nodeList != null)
            {
                return(nodeList.Any(fn));
            }

            return(false);
        }
Пример #2
0
        public void Update(float delta)
        {
            foreach (var game in _gameNodes)
            {
                if (!game.State.playing)
                {
                    continue;
                }

                if (!_spaceships.Any())
                {
                    RespawnPlayer(game);
                }
            }
        }
 /// <summary>
 /// Determines whether this instance is ready for next level.
 /// </summary>
 /// <returns><c>true</c> if this instance is ready for next level; otherwise, <c>false</c>.</returns>
 private bool IsReadyForNextLevel()
 {
     return(!asteroids.Any() && !bullets.Any() && spaceships.Any());
 }