CachedWorld.cs 638 B

1234567891011121314151617
  1. // Copyright (c) .NET Foundation. All rights reserved.
  2. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
  3. using System.Runtime.InteropServices;
  4. namespace PlatformBenchmarks
  5. {
  6. public class CachedWorld
  7. {
  8. public int Id { get; set; }
  9. public int RandomNumber { get; set; }
  10. public static implicit operator World(CachedWorld world) => new World { Id = world.Id, RandomNumber = world.RandomNumber };
  11. public static implicit operator CachedWorld(World world) => new CachedWorld { Id = world.Id, RandomNumber = world.RandomNumber };
  12. }
  13. }