Beispiel #1
0
        /// <summary>
        /// Gets the default settings based on the game and platform
        /// </summary>
        /// <param name="game">The game</param>
        /// <param name="platform">The platform</param>
        /// <returns>The settings</returns>
        public static OpenSpaceSettings GetDefaultSettings(OpenSpaceGame game, Platform platform)
        {
            Endian endian;

            // Set the byte order based on platform
            switch (platform)
            {
            case Platform.PC:
            case Platform.iOS:
            case Platform.DreamCast:
            case Platform.PlayStation2:
            case Platform.NintendoDS:
            case Platform.Nintendo3DS:
                endian = Endian.Little;
                break;

            case Platform.GameCube:
            case Platform.Nintendo64:
                endian = Endian.Big;
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(platform), platform, null);
            }

            return(new OpenSpaceSettings(endian, Encoding.GetEncoding(1252), game, platform));
        }
Beispiel #2
0
        /// <summary>
        /// Default constructor
        /// </summary>
        /// <param name="endian">The endianness</param>
        /// <param name="textEncoding">The text encoding to use</param>
        /// <param name="game">The game</param>
        /// <param name="platform">The platform</param>
        public OpenSpaceSettings(Endian endian, Encoding textEncoding, OpenSpaceGame game, Platform platform) : base(endian, textEncoding)
        {
            // Set the properties
            Game     = game;
            Platform = platform;

            // Get the engine version
            foreach (OpenSpaceEngineVersion version in Enum.GetValues(typeof(OpenSpaceEngineVersion)))
            {
                if ((int)game > (int)version)
                {
                    continue;
                }

                EngineVersion = version;
                break;
            }
        }
Beispiel #3
0
 /// <summary>
 /// Default constructor
 /// </summary>
 /// <param name="displayName">The game mode display name</param>
 /// <param name="game">The game</param>
 /// <param name="platform">The platform</param>
 public OpenSpaceGameModeInfoAttribute(string displayName, OpenSpaceGame game, Platform platform) : base(displayName)
 {
     Game     = game;
     Platform = platform;
 }