A SaveDevice used for saving player-specific data.
상속: SaveDevice
예제 #1
0
파일: StorageManager.cs 프로젝트: rc183/igf
        public override void Initialize()
        {
            base.Initialize();

#if WINDOWS || XBOX
            var shared = new SharedSaveDevice();

            shared.DeviceSelectorCanceled += (s, e) => e.Response = SaveDeviceEventResponse.Force;
            shared.DeviceDisconnected     += (s, e) => e.Response = SaveDeviceEventResponse.Force;

            _sharedDevice = shared;
#else
            _sharedDevice = new IsolatedStorageSaveDevice();
#endif

            _playerDevices = new Dictionary <PlayerIndex, IAsyncSaveDevice>();


            for (int i = 0; i < 4; i++)
            {
                var playerIndex = (PlayerIndex)Enum.ToObject(typeof(PlayerIndex), i);

#if WINDOWS || XBOX
                var playerDevice = new PlayerSaveDevice(playerIndex);

                playerDevice.DeviceSelectorCanceled += (s, e) => e.Response = SaveDeviceEventResponse.Force;
                playerDevice.DeviceDisconnected     += (s, e) => e.Response = SaveDeviceEventResponse.Force;
#else
                var playerDevice = new IsolatedStorageSaveDevice();
#endif

                _playerDevices.Add(playerIndex, playerDevice);
            }
        }
예제 #2
0
        public override void Initialize()
        {
            base.Initialize();

#if WINDOWS || XBOX
            var shared = new SharedSaveDevice();

            shared.DeviceSelectorCanceled += (s, e) => e.Response = SaveDeviceEventResponse.Force;
            shared.DeviceDisconnected += (s, e) => e.Response = SaveDeviceEventResponse.Force;

            _sharedDevice = shared;
#else
            _sharedDevice = new IsolatedStorageSaveDevice();
#endif

            _playerDevices = new Dictionary<PlayerIndex, IAsyncSaveDevice>();


            for (int i = 0; i < 4; i++)
            {
                var playerIndex = (PlayerIndex) Enum.ToObject(typeof (PlayerIndex), i);

#if WINDOWS || XBOX
                var playerDevice = new PlayerSaveDevice(playerIndex);
                
                playerDevice.DeviceSelectorCanceled += (s, e) => e.Response = SaveDeviceEventResponse.Force;
                playerDevice.DeviceDisconnected += (s, e) => e.Response = SaveDeviceEventResponse.Force;
#else
                var playerDevice = new IsolatedStorageSaveDevice();
#endif

                _playerDevices.Add(playerIndex, playerDevice);
            }
        }