2012-08-09 09:45:04 +00:00
|
|
|
using System;
|
2012-08-12 20:00:19 +00:00
|
|
|
using ANX.Framework;
|
2012-08-09 09:45:04 +00:00
|
|
|
using ANX.Framework.NonXNA;
|
|
|
|
using ANX.Framework.NonXNA.PlatformSystem;
|
2012-08-12 20:00:19 +00:00
|
|
|
using ANX.Framework.Storage;
|
2012-08-09 09:45:04 +00:00
|
|
|
|
|
|
|
// This file is part of the ANX.Framework created by the
|
|
|
|
// "ANX.Framework developer group" and released under the Ms-PL license.
|
|
|
|
// For details see: http://anxframework.codeplex.com/license
|
|
|
|
|
|
|
|
namespace ANX.PlatformSystem.Metro
|
|
|
|
{
|
|
|
|
public class MetroPlatformCreator : IPlatformSystemCreator
|
|
|
|
{
|
2012-08-12 20:00:19 +00:00
|
|
|
#region Public
|
2012-08-09 09:45:04 +00:00
|
|
|
public string Name
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
2012-08-12 20:00:19 +00:00
|
|
|
return "Platform.Metro";
|
2012-08-09 09:45:04 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public int Priority
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
|
|
|
return 100;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public bool IsSupported
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
|
|
|
return OSInformation.IsWindows;
|
|
|
|
}
|
|
|
|
}
|
2012-08-12 20:00:19 +00:00
|
|
|
#endregion
|
2012-08-09 09:45:04 +00:00
|
|
|
|
|
|
|
#region RegisterCreator
|
|
|
|
public void RegisterCreator(AddInSystemFactory factory)
|
|
|
|
{
|
2012-08-12 20:00:19 +00:00
|
|
|
Logger.Info(
|
|
|
|
"adding Metro PlatformSystem creator to collection of AddInSystemFactory");
|
2012-08-09 09:45:04 +00:00
|
|
|
factory.AddCreator(this);
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
|
2012-08-12 20:00:19 +00:00
|
|
|
#region Constructor
|
2012-08-09 09:45:04 +00:00
|
|
|
public MetroPlatformCreator()
|
|
|
|
{
|
|
|
|
}
|
2012-08-12 20:00:19 +00:00
|
|
|
#endregion
|
2012-08-09 09:45:04 +00:00
|
|
|
|
|
|
|
#region CreateGameHost
|
|
|
|
public GameHost CreateGameHost(Game game)
|
|
|
|
{
|
2012-08-09 14:57:19 +00:00
|
|
|
Logger.Info("creating Windows GameHost");
|
2012-08-09 09:45:04 +00:00
|
|
|
AddInSystemFactory.Instance.PreventSystemChange(AddInType.PlatformSystem);
|
|
|
|
return new WindowsGameHost(game);
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
|
2012-08-14 08:44:12 +00:00
|
|
|
#region CreateStorageDevice
|
2012-08-12 20:00:19 +00:00
|
|
|
public INativeStorageDevice CreateStorageDevice(StorageDevice device,
|
|
|
|
PlayerIndex player, int sizeInBytes, int directoryCount)
|
2012-08-09 09:45:04 +00:00
|
|
|
{
|
2012-08-14 08:44:12 +00:00
|
|
|
return new MetroStorageDevice();
|
2012-08-09 09:45:04 +00:00
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
|
2012-08-14 08:44:12 +00:00
|
|
|
#region CreateStorageContainer
|
2012-08-12 20:00:19 +00:00
|
|
|
public INativeStorageContainer CreateStorageContainer(StorageContainer container)
|
2012-08-09 09:45:04 +00:00
|
|
|
{
|
2012-08-14 08:44:12 +00:00
|
|
|
return new MetroStorageContainer();
|
2012-08-09 09:45:04 +00:00
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
|
2012-08-14 08:44:12 +00:00
|
|
|
#region CreateTitleContainer
|
2012-08-09 09:45:04 +00:00
|
|
|
public INativeTitleContainer CreateTitleContainer()
|
|
|
|
{
|
2012-08-14 08:44:12 +00:00
|
|
|
return new MetroTitleContainer();
|
2012-08-09 09:45:04 +00:00
|
|
|
}
|
2012-08-12 20:00:19 +00:00
|
|
|
#endregion
|
2012-08-09 09:45:04 +00:00
|
|
|
|
2012-08-12 20:00:19 +00:00
|
|
|
#region CreateGameTimer
|
2012-08-09 09:45:04 +00:00
|
|
|
public INativeGameTimer CreateGameTimer()
|
|
|
|
{
|
2012-08-12 20:00:19 +00:00
|
|
|
return new MetroGameTimer();
|
2012-08-09 09:45:04 +00:00
|
|
|
}
|
2012-08-12 20:00:19 +00:00
|
|
|
#endregion
|
2012-08-09 09:45:04 +00:00
|
|
|
|
2012-08-12 20:00:19 +00:00
|
|
|
#region CreateContentManager
|
2012-08-09 09:45:04 +00:00
|
|
|
public INativeContentManager CreateContentManager()
|
|
|
|
{
|
2012-08-12 20:00:19 +00:00
|
|
|
return new MetroContentManager();
|
2012-08-09 09:45:04 +00:00
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
}
|
|
|
|
}
|