Esempio n. 1
0
        /// <inheritdoc />
        public TGrainInterface GetGrain <TGrainInterface>(long primaryKey, string keyExtension, string grainClassNamePrefix = null)
            where TGrainInterface : IGrainWithIntegerCompoundKey
        {
            GrainFactoryBase.DisallowNullOrWhiteSpaceKeyExtensions(keyExtension);

            return((TGrainInterface)CreateGrainReference(typeof(TGrainInterface), GetGrainId(typeof(TGrainInterface), primaryKey, keyExtension: keyExtension, grainClassNamePrefix: grainClassNamePrefix)));
        }
Esempio n. 2
0
 /// <summary>
 /// Gets a reference to a grain.
 /// </summary>
 /// <typeparam name="TGrainInterface">The interface to get.</typeparam>
 /// <param name="primaryKey">The primary key of the grain.</param>
 /// <param name="grainClassNamePrefix">An optional class name prefix used to find the runtime type of the grain.</param>
 /// <returns></returns>
 public TGrainInterface GetGrain <TGrainInterface>(long primaryKey, string grainClassNamePrefix = null) where TGrainInterface : IGrainWithIntegerKey
 {
     return(Cast <TGrainInterface>(
                GrainFactoryBase.MakeGrainReference_FromType(
                    baseTypeCode => TypeCodeMapper.ComposeGrainId(baseTypeCode, primaryKey, typeof(TGrainInterface)),
                    typeof(TGrainInterface),
                    grainClassNamePrefix)));
 }
Esempio n. 3
0
        /// <inheritdoc />
        public TGrainInterface GetGrain <TGrainInterface>(Guid primaryKey, string keyExtension, string grainClassNamePrefix = null)
            where TGrainInterface : IGrainWithGuidCompoundKey
        {
            GrainFactoryBase.DisallowNullOrWhiteSpaceKeyExtensions(keyExtension);

            Type interfaceType  = typeof(TGrainInterface);
            var  implementation = this.GetGrainClassData(interfaceType, grainClassNamePrefix);
            var  grainId        = GrainId.GetGrainId(implementation.GetTypeCode(interfaceType), primaryKey, keyExtension);

            return(this.Cast <TGrainInterface>(this.MakeGrainReferenceFromType(interfaceType, grainId)));
        }
Esempio n. 4
0
        /// <summary>
        /// Gets a reference to a grain.
        /// </summary>
        /// <typeparam name="TGrainInterface">The interface to get.</typeparam>
        /// <param name="primaryKey">The primary key of the grain.</param>
        /// <param name="keyExtension">The key extention of the grain.</param>
        /// <param name="grainClassNamePrefix">An optional class name prefix used to find the runtime type of the grain.</param>
        /// <returns></returns>
        public TGrainInterface GetGrain <TGrainInterface>(long primaryKey, string keyExtension, string grainClassNamePrefix = null)
            where TGrainInterface : IGrainWithIntegerCompoundKey
        {
            GrainFactoryBase.DisallowNullOrWhiteSpaceKeyExtensions(keyExtension);

            return(Cast <TGrainInterface>(
                       GrainFactoryBase.MakeGrainReference_FromType(
                           baseTypeCode => TypeCodeMapper.ComposeGrainId(baseTypeCode, primaryKey, typeof(TGrainInterface), keyExtension),
                           typeof(TGrainInterface),
                           grainClassNamePrefix)));
        }
            public System.Threading.Tasks.Task <Frontend.Library.Models.PlayerInfo> Subscribe(Backend.GrainInterfaces.IPlayerObserver playerObserver)
            {
                GrainFactoryBase.CheckGrainObserverParamInternal(playerObserver);

                return(base.InvokeMethodAsync <Frontend.Library.Models.PlayerInfo>(-1236982852, new object[] { playerObserver is GrainBase ? Backend.GrainInterfaces.PlayerObserverFactory.Cast(playerObserver.AsReference()) : playerObserver }, TimeSpan.Zero));
            }
 public static IGameServerGrain GetGrain(Guid primaryKey)
 {
     return(Cast(GrainFactoryBase.MakeGrainReferenceInternal(typeof(IGameServerGrain), 1930156440, primaryKey)));
 }
Esempio n. 7
0
 public static IPerson GetGrain(long primaryKey)
 {
     return(Cast(GrainFactoryBase.MakeGrainReferenceInternal(typeof(IPerson), 438111581, primaryKey)));
 }
Esempio n. 8
0
 public static IDoStuff GetGrain(Guid primaryKey)
 {
     return(Cast(GrainFactoryBase.MakeGrainReferenceInternal(typeof(IDoStuff), 1237371746, primaryKey)));
 }
 public static IPerson GetGrain(Guid primaryKey)
 {
     return(Cast(GrainFactoryBase.MakeGrainReferenceInternal(typeof(IPerson), -627797884, primaryKey)));
 }
 public static IPlayerRegistrationGrain GetGrain(Guid primaryKey, string grainClassNamePrefix)
 {
     return(Cast(GrainFactoryBase.MakeGrainReferenceInternal(typeof(IPlayerRegistrationGrain), 402110932, primaryKey, grainClassNamePrefix)));
 }
 public static IDeviceGrain GetGrain(Guid primaryKey, string grainClassNamePrefix)
 {
     return(Cast(GrainFactoryBase.MakeGrainReferenceInternal(typeof(IDeviceGrain), -1248350959, primaryKey, grainClassNamePrefix)));
 }
 public static IDeviceGrain GetGrain(Guid primaryKey)
 {
     return(Cast(GrainFactoryBase.MakeGrainReferenceInternal(typeof(IDeviceGrain), -1248350959, primaryKey)));
 }
Esempio n. 13
0
 public static IPushNotifierGrain GetGrain(Guid primaryKey, string grainClassNamePrefix)
 {
     return(Cast(GrainFactoryBase.MakeGrainReferenceInternal(typeof(IPushNotifierGrain), -2137827649, primaryKey, grainClassNamePrefix)));
 }
Esempio n. 14
0
 public static IPushNotifierGrain GetGrain(Guid primaryKey)
 {
     return(Cast(GrainFactoryBase.MakeGrainReferenceInternal(typeof(IPushNotifierGrain), -2137827649, primaryKey)));
 }
Esempio n. 15
0
 public static IDeviceGrain GetGrain(long primaryKey, string grainClassNamePrefix)
 {
     return(Cast(GrainFactoryBase.MakeGrainReferenceInternal(typeof(IDeviceGrain), -239237304, primaryKey, grainClassNamePrefix)));
 }
Esempio n. 16
0
 public static IDeviceGrain GetGrain(long primaryKey)
 {
     return(Cast(GrainFactoryBase.MakeGrainReferenceInternal(typeof(IDeviceGrain), -239237304, primaryKey)));
 }
 public static IPerson GetGrain(Guid primaryKey, string grainClassNamePrefix)
 {
     return(Cast(GrainFactoryBase.MakeGrainReferenceInternal(typeof(IPerson), -627797884, primaryKey, grainClassNamePrefix)));
 }
 public static IGameServerGrain GetGrain(Guid primaryKey, string grainClassNamePrefix)
 {
     return(Cast(GrainFactoryBase.MakeGrainReferenceInternal(typeof(IGameServerGrain), 1930156440, primaryKey, grainClassNamePrefix)));
 }
 public static IPlayerRegistrationGrain GetGrain(long primaryKey)
 {
     return(Cast(GrainFactoryBase.MakeGrainReferenceInternal(typeof(IPlayerRegistrationGrain), 402110932, primaryKey)));
 }
Esempio n. 20
0
 public static IStackGrain GetGrain(Guid primaryKey)
 {
     return(Cast(GrainFactoryBase.MakeGrainReferenceInternal(typeof(IStackGrain), 1724875955, primaryKey)));
 }
            public System.Threading.Tasks.Task Register(Backend.GrainInterfaces.IPlayerObserver playerObserver)
            {
                GrainFactoryBase.CheckGrainObserverParamInternal(playerObserver);

                return(base.InvokeMethodAsync <object>(1454675116, new object[] { playerObserver is GrainBase ? Backend.GrainInterfaces.PlayerObserverFactory.Cast(playerObserver.AsReference()) : playerObserver }, TimeSpan.Zero));
            }
Esempio n. 22
0
 public static IPerson GetGrain(long primaryKey, string grainClassNamePrefix)
 {
     return(Cast(GrainFactoryBase.MakeGrainReferenceInternal(typeof(IPerson), 438111581, primaryKey, grainClassNamePrefix)));
 }
Esempio n. 23
0
 public static IStackGrain GetGrain(Guid primaryKey, string grainClassNamePrefix)
 {
     return(Cast(GrainFactoryBase.MakeGrainReferenceInternal(typeof(IStackGrain), 1724875955, primaryKey, grainClassNamePrefix)));
 }
 public static ILobbyGrain GetGrain(Guid primaryKey)
 {
     return(Cast(GrainFactoryBase.MakeGrainReferenceInternal(typeof(ILobbyGrain), 880933729, primaryKey)));
 }
 public static ILobbyGrain GetGrain(Guid primaryKey, string grainClassNamePrefix)
 {
     return(Cast(GrainFactoryBase.MakeGrainReferenceInternal(typeof(ILobbyGrain), 880933729, primaryKey, grainClassNamePrefix)));
 }
 public static IPlayerGrain GetGrain(Guid primaryKey)
 {
     return(Cast(GrainFactoryBase.MakeGrainReferenceInternal(typeof(IPlayerGrain), -1571374391, primaryKey)));
 }
Esempio n. 27
0
            public System.Threading.Tasks.Task SubscribeForUpdates(ObserverInterfaces.IObserve subscriber)
            {
                GrainFactoryBase.CheckGrainObserverParamInternal(subscriber);

                return(base.InvokeMethodAsync <object>(989382207, new object[] { subscriber is GrainBase ? ObserverInterfaces.ObserveFactory.Cast(subscriber.AsReference()) : subscriber }, TimeSpan.Zero));
            }
 public static IPlayerGrain GetGrain(Guid primaryKey, string grainClassNamePrefix)
 {
     return(Cast(GrainFactoryBase.MakeGrainReferenceInternal(typeof(IPlayerGrain), -1571374391, primaryKey, grainClassNamePrefix)));
 }
Esempio n. 29
0
 public static IDoStuff GetGrain(Guid primaryKey, string grainClassNamePrefix)
 {
     return(Cast(GrainFactoryBase.MakeGrainReferenceInternal(typeof(IDoStuff), 1237371746, primaryKey, grainClassNamePrefix)));
 }
Esempio n. 30
0
 public static IClient GetGrain(Guid primaryKey, string grainClassNamePrefix)
 {
     return(Cast(GrainFactoryBase.MakeGrainReferenceInternal(typeof(IClient), 523268002, primaryKey, grainClassNamePrefix)));
 }