/// <summary>
        /// The main entry point for the application.
        /// </summary>
        static void Main(string[] args)
        {
            Configuration.Load();
            //
            String path = Configuration.Settings["Log"];

            if (!String.IsNullOrEmpty(path))
            {
                if (!path.Contains(@"\"))
                {
                    String folder = Path.GetDirectoryName(typeof(ServiceEngine).Assembly.Location);
                    path = String.Format(@"{0}\{1}", folder, path);
                }
                Log.Activate(path);
            }
            Log.Create(Program.Name);

#if DEBUG
            args = new String[] { "d" };
#endif
            if (args.Length == 0)
            {
                ServiceBase[] services = new ServiceBase[] { new HostService() };
                ServiceBase.Run(services);
            }
            else if (args.Length == 1)
            {
                String argument = args[0];
                if (argument.Length > 1)
                {
                    argument = argument.Substring(1);
                }
                //
                if (argument.Equals("d"))
                {
                    _daemon = true;
                    //
                    ServiceEngine engine = new ServiceEngine();
                    engine.Start();
                }
                else if (argument.StartsWith("i"))
                {
                    Program.Install();
                }
                else if (argument.StartsWith("u"))
                {
                    Program.Uninstall();
                }
                else
                {
                    Console.WriteLine("Unrecognized command line parameter.");
                }
            }
            else
            {
                Console.WriteLine("Invalid number of command line parameters.");
            }
        }
    /// <summary>
    /// Creates a log
    /// </summary>
    private void CreateLog(bool isCustomStart, Vector3 customStartPos)
    {
        // Determine log type
        MapItemType logType    = MapItemType.Log_1;
        float       rand       = Random.value;
        float       cumulative = 0f;

        for (int i = 0; i < 3; ++i)
        {
            cumulative += m_logTypeProb[i];
            if (rand <= cumulative)
            {
                logType += i;
                break;
            }
        }

        // Get the log asset
        Platform newPlatform = m_mapAssetPool.GetPlatformAssetPool(logType).GetAsset();
        Log      newLog      = (Log)newPlatform;

        m_logs.Add(newLog);
        newLog.gameObject.SetActive(true);
        newLog.Activate();

        // Start the log's movement
        if (m_direction == LaneDirection.RIGHT)
        {
            newLog.StartMovement(m_fastSpeed, m_logSpeed, m_edgeLeftPos, m_activeLeftPos,
                                 m_activeRightPos, m_edgeRightPos, OnLogEndMovement,
                                 isCustomStart, customStartPos);
        }
        else if (m_direction == LaneDirection.LEFT)
        {
            newLog.StartMovement(m_fastSpeed, m_logSpeed, m_edgeRightPos, m_activeRightPos,
                                 m_activeLeftPos, m_edgeLeftPos, OnLogEndMovement,
                                 isCustomStart, customStartPos);
        }

        // Spawn a coin
        SpawnCoin(newLog);
    }