public ServerParam create() { switch (param) { case "C:\\America\\": serverParam = new ServerParamAmerica(); break; case "C:\\Europa\\": serverParam = new ServerParamEuropa(); break; case "C:\\Europa2\\": serverParam = new ServerParamEuropa2(); break; case "C:\\SINGA\\": serverParam = new ServerParamSing(); break; case "C:\\America2\\": serverParam = new ServerParamAmerica2(); break; default: serverParam = new ServerParamSing(); break; } return(serverParam); }
private static void PrintHelp() { Console.WriteLine("Usage:"); Console.WriteLine(" Server [options]"); Console.WriteLine(" Server --help"); Console.WriteLine(""); ServerParam.PrintOptionsHelp(); }
/// <summary> /// Default constructor for the Stadium class /// </summary> public Stadium() { ServerParam.Initialize(System.Environment.GetCommandLineArgs()); fld = new Rectangle(new Vector(0.0f, 0.0f), new Vector(ServerParam.PITCH_LENGTH + ServerParam.PITCH_MARGIN * 2.0f, ServerParam.PITCH_WIDTH + ServerParam.PITCH_MARGIN * 2.0f)); pt = new Rectangle(new Vector(0.0f, 0.0f), new Vector(ServerParam.PITCH_LENGTH + ServerParam.Instance.Ball_size * 2, ServerParam.PITCH_WIDTH + ServerParam.Instance.Ball_size * 2)); g_r = new Rectangle(new Vector((+ServerParam.PITCH_LENGTH + ServerParam.GOAL_DEPTH) * 0.5f + ServerParam.Instance.Ball_size, 0.0f), new Vector(ServerParam.GOAL_DEPTH, ServerParam.Instance.Goal_width + ServerParam.Instance.GoalPostRadius)); g_l = new Rectangle(new Vector((-ServerParam.PITCH_LENGTH - ServerParam.GOAL_DEPTH) * 0.5f - ServerParam.Instance.Ball_size, 0.0f), new Vector(ServerParam.GOAL_DEPTH, ServerParam.Instance.Goal_width + ServerParam.Instance.GoalPostRadius)); Ball = null; Playmode = PlayMode.BeforeKickOff; Time = 0; // !!! registration order is very important !!! // TODO: fix the dependencies between referees. // Referees.Add(new TimeRef(this)); // Referees.Add(new BallStuckRef(this)); // Referees.Add(new OffsideRef(this)); // Referees.Add(new FreeKickRef(this)); // Referees.Add(new TouchRef(this)); // Referees.Add(new CatchRef(this)); // Referees.Add(new KeepawayRef(this)); // Referees.Add(new PenaltyRef(this)); }