/// <summary> /// The entry point for a server /// </summary> /// <param name="holder"></param> /// <param name="proposal"></param> public void CreateSelfTestServer(NetworkServerData holder, SettingsProposal proposal) { RunServer(holder); ReceiveConfiguration(holder); proposal.Push(holder.Settings, true); InstantiateWorld(holder); }
/// <summary> /// Creates the world for non-networking case: BotDemo or Tutorial modes. /// </summary> /// <param name="loadingData"></param> /// <param name="proposal"></param> /// <param name="factory"></param> /// <returns></returns> public IWorld CreateSimpleMode(LoadingData loadingData, SettingsProposal proposal, ControllerFactory factory) { var configuration = new Configuration(); configuration.LoadingData = loadingData; var competitions = GetCompetitions(configuration.LoadingData); configuration.Settings = competitions.Logic.CreateDefaultSettings(); proposal.Push(configuration.Settings, true); var stateName = configuration.Settings.WorldState; if (stateName == null) { if (competitions.Logic.PredefinedWorldStates.Count == 0) throw new Exception("The count of predefined stated in the " + competitions.Logic.GetType() + " is zero"); stateName = competitions.Logic.PredefinedWorldStates[0]; } var state = competitions.Logic.CreateWorldState(stateName); return CreateWorld(configuration, factory, state); }