using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using V3.Camera;
namespace V3.Data
{
///
/// The graphics options.
///
[Serializable]
public sealed class Options
{
///
/// All available screen resolutions.
///
public static List Resolutions { get; } = new List
{
new Point(800, 480),
new Point(800, 600),
new Point(1024, 768),
new Point(1280, 800),
new Point(1280, 1024),
new Point(1366, 768),
new Point(1920, 1080)
};
///
/// All available camera types.
///
public static List CameraTypes { get; } =
Enum.GetValues(typeof (CameraType)).Cast().ToList();
///
/// All available debug modes.
///
public static List DebugModes { get; } =
Enum.GetValues(typeof (DebugMode)).Cast().ToList();
///
/// All available volume settings.
///
public static List Volumes { get; } = new List()
{
10,
20,
30,
40,
50,
60,
70,
80,
90,
100
};
private static readonly Point sDefaultResolution = Resolutions[0];
private static readonly bool sDefaultIsFullScreen = false;
private static readonly DebugMode sDefaultDebugMode = DebugMode.Off;
private static readonly CameraType sDefaultCameraType = CameraType.Scrolling;
private static readonly bool sDefaultIsMuted = false;
private static readonly int sDefaultVolume = 100;
///
/// The current screen resolution.
///
public Point Resolution { get; set; } = sDefaultResolution;
///
/// True if the game should be run in full screen, otherwise false.
///
public bool IsFullScreen { get; set; } = sDefaultIsFullScreen;
///
/// The current debug mode.
///
public DebugMode DebugMode { get; set; } = sDefaultDebugMode;
///
/// The current camera type.
///
public CameraType CameraType { get; set; } = sDefaultCameraType;
///
/// True if the sound is muted, otherwise false.
///
public bool IsMuted { get; set; } = sDefaultIsMuted;
///
/// The volume to use for the sound (if the sound is not muted), range
/// 0 .. 100.
///
public int Volume { get; set; } = sDefaultVolume;
///
/// Returns the effective volume with regard to the mute and volume
/// settings.
///
/// the effective volume that should be used for sound
public float GetEffectiveVolume()
{
return IsMuted ? 0 : ((float) Volume) / 100;
}
}
}