コード例 #1
0
 public MapSeeder(IMap map, IServiceProvider serviceProvider, GameObjectsCreationEvent gameObjectsCreationEvent, IEventRecorder eventRecorder)
 {
     _map                      = map;
     _serviceProvider          = serviceProvider;
     _gameObjectsCreationEvent = gameObjectsCreationEvent;
     _eventRecorder            = eventRecorder;
 }
コード例 #2
0
        /// <summary>
        /// Asserts that at least one occurrence of the event had arguments matching all predicates.
        /// </summary>
        public static IEventRecorder WithArgs <T>(this IEventRecorder eventRecorder, params Expression <Func <T, bool> >[] predicates)
        {
            Func <T, bool>[] compiledPredicates = predicates.Select(p => p?.Compile()).ToArray();

            if (!eventRecorder.First().Parameters.OfType <T>().Any())
            {
                throw new ArgumentException("No argument of event " + eventRecorder.EventName + " is of type <" + typeof(T) + ">.");
            }

            bool expected = eventRecorder.Any(recordedEvent =>
            {
                T[] parameters        = recordedEvent.Parameters.OfType <T>().ToArray();
                int parametersToCheck = Math.Min(parameters.Length, predicates.Length);

                bool isMatch = true;
                for (int i = 0; i < parametersToCheck && isMatch; i++)
                {
                    isMatch = compiledPredicates[i]?.Invoke(parameters[i]) ?? true;
                }

                return(isMatch);
            });

            if (!expected)
            {
                Execute.Assertion
                .FailWith("Expected at least one event with arguments matching {0}, but found none.", string.Join(" | ", predicates.Where(p => p != null).Select(p => p.Body.ToString())));
            }

            return(eventRecorder);
        }
コード例 #3
0
ファイル: EaterImpl.cs プロジェクト: darknews23/LifeGame
 public EaterImpl(ILoggerFactory loggerFactory, EatingEvent eatingEvent, IEventRecorder recorder)
 {
     _logger        = loggerFactory.CreateLogger <EaterImpl>();
     _stringBuilder = new StringBuilder();
     _eatingEvent   = eatingEvent;
     _eventRecorder = recorder;
 }
コード例 #4
0
 public MaleImpl(ILoggerFactory loggerFactory, ReproductionEvent reproductionEvent, IEventRecorder eventRecorder)
 {
     _reproductionEvent = reproductionEvent;
     _eventRecorder     = eventRecorder;
     _logger            = loggerFactory.CreateLogger <MaleImpl>();
     _stringBuilder     = new StringBuilder();
 }
コード例 #5
0
 public MovableImpl(ILoggerFactory loggerFactory, MovementEvent movementEvent, IEventRecorder eventRecorder)
 {
     _movementEvent = movementEvent;
     _eventRecorder = eventRecorder;
     _logger        = loggerFactory.CreateLogger <MovableImpl>();
     _stringBuilder = new StringBuilder();
 }
コード例 #6
0
        /// <summary>
        ///   Generates an eventhandler for an event of type eventSignature that calls RegisterEvent on recorder
        ///   when invoked.
        /// </summary>
        public static Delegate GenerateHandler(Type eventSignature, IEventRecorder recorder)
        {
            Type returnType = GetDelegateReturnType(eventSignature);

            Type[] parameters = GetDelegateParameterTypes(eventSignature);

            var eventHandler = new DynamicMethod(
                eventSignature.Name + "DynamicHandler",
                returnType,
                AppendParameterListThisReference(parameters),
                recorder.GetType()
                .Module);
            MethodInfo methodToCall = typeof(IEventRecorder).GetMethod("RecordEvent",
                                                                       BindingFlags.Instance | BindingFlags.Public);

            ILGenerator ilGen = eventHandler.GetILGenerator();

            // Make room for the one and only local variable in our function
            ilGen.DeclareLocal(typeof(object[]));

            // Create the object array for the parameters and store in local var index 0
            ilGen.Emit(OpCodes.Ldc_I4, parameters.Length);
            ilGen.Emit(OpCodes.Newarr, typeof(Object));
            ilGen.Emit(OpCodes.Stloc_0);

            for (var index = 0; index < parameters.Length; index++)
            {
                // Push the object array onto the evaluation stack
                ilGen.Emit(OpCodes.Ldloc_0);

                // Push the array index to store our parameter in onto the evaluation stack
                ilGen.Emit(OpCodes.Ldc_I4, index);

                // Load the parameter
                ilGen.Emit(OpCodes.Ldarg, index + 1);

                // Box value-type parameters
                if (parameters[index]
                    .IsValueType)
                {
                    ilGen.Emit(OpCodes.Box, parameters[index]);
                }

                // Store the parameter in the object array
                ilGen.Emit(OpCodes.Stelem_Ref);
            }

            // Push the this-reference on the stack as param 0 for calling the handler
            ilGen.Emit(OpCodes.Ldarg_0);

            // Push the object array onto the stack as param 1 for calling the handler
            ilGen.Emit(OpCodes.Ldloc_0);

            // Call the handler
            ilGen.EmitCall(OpCodes.Call, methodToCall, null);

            ilGen.Emit(OpCodes.Ret);

            return(eventHandler.CreateDelegate(eventSignature, recorder));
        }
コード例 #7
0
        /// <summary>
        ///   Generates an eventhandler for an event of type eventSignature that calls RegisterEvent on recorder
        ///   when invoked.
        /// </summary>
        public static Delegate GenerateHandler(Type eventSignature, IEventRecorder recorder)
        {
            Type returnType = GetDelegateReturnType(eventSignature);
            Type[] parameters = GetDelegateParameterTypes(eventSignature);

            var eventHandler = new DynamicMethod(
                eventSignature.Name + "DynamicHandler",
                returnType,
                AppendParameterListThisReference(parameters),
                recorder.GetType()
                .Module);
            MethodInfo methodToCall = typeof (IEventRecorder).GetMethod("RecordEvent",
                BindingFlags.Instance | BindingFlags.Public);

            ILGenerator ilGen = eventHandler.GetILGenerator();

            // Make room for the one and only local variable in our function
            ilGen.DeclareLocal(typeof (object[]));

            // Create the object array for the parameters and store in local var index 0
            ilGen.Emit(OpCodes.Ldc_I4, parameters.Length);
            ilGen.Emit(OpCodes.Newarr, typeof (Object));
            ilGen.Emit(OpCodes.Stloc_0);

            for (var index = 0; index < parameters.Length; index++)
            {
                // Push the object array onto the evaluation stack
                ilGen.Emit(OpCodes.Ldloc_0);

                // Push the array index to store our parameter in onto the evaluation stack
                ilGen.Emit(OpCodes.Ldc_I4, index);

                // Load the parameter
                ilGen.Emit(OpCodes.Ldarg, index + 1);

                // Box value-type parameters
                if (parameters[index]
                    .IsValueType)
                {
                    ilGen.Emit(OpCodes.Box, parameters[index]);
                }

                // Store the parameter in the object array
                ilGen.Emit(OpCodes.Stelem_Ref);
            }

            // Push the this-reference on the stack as param 0 for calling the handler
            ilGen.Emit(OpCodes.Ldarg_0);

            // Push the object array onto the stack as param 1 for calling the handler
            ilGen.Emit(OpCodes.Ldloc_0);

            // Call the handler
            ilGen.EmitCall(OpCodes.Call, methodToCall, null);

            ilGen.Emit(OpCodes.Ret);

            return eventHandler.CreateDelegate(eventSignature, recorder);
        }
コード例 #8
0
 public Fish(IMap map, IGrowable growable, IMovable movable, IEater eater, IEatable eatable, IGender gender,
             DeathEvent deathEvent, IEventRecorder eventRecorder)
     : base(map, growable, movable, eater, gender, deathEvent, eventRecorder)
 {
     Hp       = 10;
     _eatable = eatable;
     _eatable.EatableOwner = this;
 }
コード例 #9
0
        public RacesWorkflow(ICompetitionContext context, IDistanceDisciplineExpertManager expertManager, IEventRecorder recorder)
        {
            this.context       = context;
            this.expertManager = expertManager;
            this.recorder      = recorder;

            context.ProxyCreationEnabled = false;
            context.LazyLoadingEnabled   = false;
        }
コード例 #10
0
        public DistanceDrawingWorkflow(ICompetitionContext context, IDisciplineCalculatorManager calculatorManager, IDistanceDisciplineExpertManager distanceExpertManager,
                                       IEventRecorder recorder)
        {
            this.context               = context;
            this.calculatorManager     = calculatorManager;
            this.distanceExpertManager = distanceExpertManager;

            personTimesWorkflow = new PersonTimesWorkflow(context, calculatorManager, distanceExpertManager);
            distancesWorkflow   = new DistancesWorkflow(context, calculatorManager, distanceExpertManager, recorder);
        }
コード例 #11
0
        public KubeResourceStore(IKubernetes client, IEventRecorder eventRecorder, ILogger <KubeResourceStore> logger)
        {
            _client        = client ?? throw new ArgumentNullException(nameof(client));
            _eventRecorder = eventRecorder ?? throw new ArgumentNullException(nameof(eventRecorder));
            _logger        = logger ?? throw new ArgumentNullException(nameof(logger));

            _backgroundCts      = new CancellationTokenSource();
            _watchIngressesTask = WatchIngresses();
            _watchServicesTask  = WatchServices();
            _watchEndpointsTask = WatchServiceEndpoints();
        }
コード例 #12
0
ファイル: Animal.cs プロジェクト: darknews23/LifeGame
 protected Animal(IMap map, IGrowable growable, IMovable movable, IEater eater, IGender gender,
                  DeathEvent deathEvent, IEventRecorder eventRecorder) : base(map, growable, deathEvent, eventRecorder)
 {
     IsPregnant          = false;
     _gender             = gender;
     _gender.GenderOwner = this;
     _eater                = eater;
     _eater.EaterOwner     = this;
     _movable              = movable;
     _movable.MovableOwner = this;
 }
        /// <summary>
        /// Asserts that an object has not raised a particular event.
        /// </summary>
        /// <param name="eventName">
        /// The name of the event that should not be raised.
        /// </param>
        /// <param name="because">
        /// A formatted phrase explaining why the assertion should be satisfied. If the phrase does not
        /// start with the word <i>because</i>, it is prepended to the message.
        /// </param>
        /// <param name="becauseArgs">
        /// Zero or more values to use for filling in any <see cref="string.Format(string,object[])"/> compatible placeholders.
        /// </param>
        /// <remarks>
        /// You must call <see cref="MonitorEvents"/> on the same object prior to this call so that Fluent Assertions can
        /// subscribe for the events of the object.
        /// </remarks>
        public void NotRaise(string eventName, string because = "", params object[] becauseArgs)
        {
            IEventRecorder eventRecorder = monitor.GetEventRecorder(eventName);

            if (eventRecorder.Any())
            {
                Execute.Assertion
                .BecauseOf(because, becauseArgs)
                .FailWith("Expected object {0} to not raise event {1}{reason}, but it did.", monitor.Subject, eventName);
            }
        }
コード例 #14
0
ファイル: FemaleImpl.cs プロジェクト: darknews23/LifeGame
 public FemaleImpl(ILoggerFactory loggerFactory, GettingPregnantEvent gettingPregnantEvent,
                   PregnancyProgressionEvent pregnancyProgressionEvent, BirthEvent birthEvent, GameObjectsCreationEvent gameObjectsCreationEvent,
                   IEventRecorder eventRecorder)
 {
     _gettingPregnantEvent      = gettingPregnantEvent;
     _pregnancyProgressionEvent = pregnancyProgressionEvent;
     _birthEvent = birthEvent;
     _gameObjectsCreationEvent = gameObjectsCreationEvent;
     _eventRecorder            = eventRecorder;
     _logger        = loggerFactory.CreateLogger <FemaleImpl>();
     _stringBuilder = new StringBuilder();
 }
コード例 #15
0
        /// <summary>
        /// Asserts that an object has not raised a particular event.
        /// </summary>
        /// <param name="eventSource">The object exposing the event.</param>
        /// <param name="eventName">
        /// The name of the event that should not be raised.
        /// </param>
        /// <param name="because">
        /// A formatted phrase explaining why the assertion should be satisfied. If the phrase does not
        /// start with the word <i>because</i>, it is prepended to the message.
        /// </param>
        /// <param name="becauseArgs">
        /// Zero or more values to use for filling in any <see cref="string.Format(string,object[])"/> compatible placeholders.
        /// </param>
        /// <remarks>
        /// You must call <see cref="MonitorEvents"/> on the same object prior to this call so that Fluent Assertions can
        /// subscribe for the events of the object.
        /// </remarks>
        public static void ShouldNotRaise(
            this object eventSource, string eventName, string because, params object[] becauseArgs)
        {
            IEventRecorder eventRecorder = EventMonitor.Get(eventSource).GetEventRecorder(eventName);

            if (eventRecorder.Any())
            {
                Execute.Assertion
                .BecauseOf(because, becauseArgs)
                .FailWith("Expected object {0} to not raise event {1}{reason}, but it did.", eventSource, eventName);
            }
        }
コード例 #16
0
        /// <summary>
        /// Asserts that only one event was raised.
        /// </summary>
        /// <param name="eventRecorder">The IEventRecorder to check.</param>
        /// <returns>The IEventRecorder instance for chaining.</returns>
        public static IEventRecorder OnlyOnce(this IEventRecorder eventRecorder)
        {
            var count = eventRecorder.Count();

            if (count != 1)
            {
                Execute.Assertion.FailWith(
                    "Expected only 1 event to be raised, but found {0}.", count);
            }

            return(eventRecorder);
        }
コード例 #17
0
        public CompetitionsWorkflow(ICompetitionContext context, IDisciplineCalculatorManager calculatorManager, IDistanceDisciplineExpertManager distanceExpertManager,
                                    IEventRecorder recorder)
        {
            this.context               = context;
            this.calculatorManager     = calculatorManager;
            this.recorder              = recorder;
            this.distanceExpertManager = distanceExpertManager;

            DistancesWorkflow            = new DistancesWorkflow(context, calculatorManager, distanceExpertManager, recorder);
            DistanceCombinationsWorkflow = new DistanceCombinationsWorkflow(context, recorder);
            LicensesWorkflow             = new LicensesWorkflow(context, calculatorManager, recorder);
            RacesWorkflow = new RacesWorkflow(context, distanceExpertManager, recorder);
        }
コード例 #18
0
        public SimulatedAppliance(ILogger <BaseAppliance> logger,
                                  IHub hub,
                                  IThermocouple thermo1,
                                  IThermocouple thermo2,
                                  IThermocouple thermo3,
                                  IThermocouple thermo4,
                                  IThermocouple thermo5,
                                  IThermocouple thermo6,
                                  IThermocouple thermo7,
                                  IThermocouple thermo8,
                                  IPid pid1,
                                  IPid pid2,
                                  IPid pid3,
                                  ISsr ssr1,
                                  ISsr ssr2,
                                  IEventRecorder eventRecorder)
            : base(logger)
        {
            _hub = hub;

            thermocouples.Add(thermo1);
            thermocouples.Add(thermo2);
            thermocouples.Add(thermo3);
            thermocouples.Add(thermo4);
            thermocouples.Add(thermo5);
            thermocouples.Add(thermo6);
            thermocouples.Add(thermo7);
            thermocouples.Add(thermo8);

            pids.Add(pid1);
            pids.Add(pid2);
            pids.Add(pid3);

            ssrs.Add(ssr1);
            ssrs.Add(ssr2);

            eventRecorders.Add(eventRecorder);

            Configure();

            // This initially starts the process.
            _hub.Publish <ComponentStateRequest <PidState> >(new ComponentStateRequest <PidState> {
                Location = Location.HLT,
                Updates  = (state) => {
                    state.SetPoint  = Temperature.RoomTemp + 10;
                    state.PidMode   = PidMode.Temperature;
                    state.IsEngaged = true;
                }
            });
        }
コード例 #19
0
 public CredentialsOperator(IKubernetes client,
                            ILogger <Operator <CredentialsResource> > logger,
                            IKubernetesService k8sService,
                            DatabaseServerRehydrator rehydrator,
                            IEventRecorder <CredentialsResource> eventRecorder,
                            ISqlManagementService sqlService,
                            SecretSourceRehydrator secretSourceRehydrator) : base(client, logger, 1000, 100, 5)
 {
     this.k8sService             = k8sService;
     this.rehydrator             = rehydrator;
     this.eventRecorder          = eventRecorder;
     this.sqlService             = sqlService;
     this.secretSourceRehydrator = secretSourceRehydrator;
 }
コード例 #20
0
        public DatabaseOperator(IKubernetes client,
                                ILogger <Operator <DatabaseResource> > logger,
                                IKubernetesService k8sService,
                                ISqlManagementService sqlService,
                                IEventRecorder <DatabaseResource> eventRecorder,
                                DatabaseServerRehydrator rehydrator)
            : base(client, logger)
        {
            this.k8sService    = k8sService;
            this.sqlService    = sqlService;
            this.eventRecorder = eventRecorder;
            this.rehydrator    = rehydrator;

            Filters.Add(new IgnoreStatusUpdatesOperatorFilter <DatabaseResource, DatabaseStatus>());
        }
        /// <summary>
        /// Asserts that an object has not raised the <see cref="INotifyPropertyChanged.PropertyChanged"/> event for a particular property.
        /// </summary>
        /// <param name="propertyExpression">
        /// A lambda expression referring to the property for which the property changed event should have been raised.
        /// </param>
        /// <param name="because">
        /// A formatted phrase explaining why the assertion should be satisfied. If the phrase does not
        /// start with the word <i>because</i>, it is prepended to the message.
        /// </param>
        /// <param name="becauseArgs">
        /// Zero or more values to use for filling in any <see cref="string.Format(string,object[])"/> compatible placeholders.
        /// </param>
        /// <remarks>
        /// You must call <see cref="AssertionExtensions.Monitor"/> on the same object prior to this call so that Fluent Assertions can
        /// subscribe for the events of the object.
        /// </remarks>
        public void NotRaisePropertyChangeFor(Expression <Func <T, object> > propertyExpression,
                                              string because = "", params object[] becauseArgs)
        {
            IEventRecorder eventRecorder = monitor.GetEventRecorder(PropertyChangedEventName);

            string propertyName = propertyExpression.GetPropertyInfo().Name;

            if (eventRecorder.Any(@event => GetAffectedPropertyName(@event) == propertyName))
            {
                Execute.Assertion
                .BecauseOf(because, becauseArgs)
                .FailWith("Did not expect object {0} to raise the {1} event for property {2}{reason}, but it did.",
                          monitor.Subject, PropertyChangedEventName, propertyName);
            }
        }
コード例 #22
0
        public DeploymentScriptOperator(IKubernetes client,
                                        ILogger <Operator <DeploymentScriptResource> > logger,
                                        IKubernetesService k8sService,
                                        DatabaseServerRehydrator rehydrator,
                                        ISqlManagementService sqlService,
                                        IEventRecorder <DeploymentScriptResource> eventRecorder,
                                        IMetrics metrics) : base(client, logger, 1000, 100, 5)
        {
            this.k8sService    = k8sService;
            this.rehydrator    = rehydrator;
            this.sqlService    = sqlService;
            this.eventRecorder = eventRecorder;
            Metrics            = metrics;

            Filters.Add(new IgnoreStatusUpdatesOperatorFilter <DeploymentScriptResource, DeploymentScriptStatus>());
        }
        /// <summary>
        /// Asserts that an object has raised the <see cref="INotifyPropertyChanged.PropertyChanged"/> event for a particular property.
        /// </summary>
        /// <param name="propertyExpression">
        /// A lambda expression referring to the property for which the property changed event should have been raised, or
        /// <c>null</c> to refer to all properties.
        /// </param>
        /// <param name="because">
        /// A formatted phrase explaining why the assertion should be satisfied. If the phrase does not
        /// start with the word <i>because</i>, it is prepended to the message.
        /// </param>
        /// <param name="becauseArgs">
        /// Zero or more values to use for filling in any <see cref="string.Format(string,object[])"/> compatible placeholders.
        /// </param>
        /// <remarks>
        /// You must call <see cref="AssertionExtensions.Monitor"/> on the same object prior to this call so that Fluent Assertions can
        /// subscribe for the events of the object.
        /// </remarks>
        public IEventRecorder RaisePropertyChangeFor(Expression <Func <T, object> > propertyExpression,
                                                     string because = "", params object[] becauseArgs)
        {
            IEventRecorder eventRecorder = monitor.GetEventRecorder(PropertyChangedEventName);
            string         propertyName  = propertyExpression?.GetPropertyInfo().Name;

            if (!eventRecorder.Any())
            {
                Execute.Assertion
                .BecauseOf(because, becauseArgs)
                .FailWith("Expected object {0} to raise event {1} for property {2}{reason}, but it did not.",
                          monitor.Subject, PropertyChangedEventName, propertyName);
            }

            return(eventRecorder.WithArgs <PropertyChangedEventArgs>(args => args.PropertyName == propertyName));
        }
コード例 #24
0
        /// <summary>
        /// Asserts that at least one occurrence of the event had an <see cref="EventArgs"/> object matching a predicate.
        /// </summary>
        public static IEventRecorder WithArgs <T>(this IEventRecorder eventRecorder, Expression <Func <T, bool> > predicate) where T : EventArgs
        {
            Func <T, bool> compiledPredicate = predicate.Compile();

            if (!eventRecorder.First().Parameters.OfType <T>().Any())
            {
                throw new ArgumentException("No argument of event " + eventRecorder.EventName + " is of type <" + typeof(T) + ">.");
            }

            if (!eventRecorder.Any(@event => compiledPredicate(@event.Parameters.OfType <T>().Single())))
            {
                Execute.Assertion
                .FailWith("Expected at least one event with arguments matching {0}, but found none.", predicate.Body);
            }

            return(eventRecorder);
        }
コード例 #25
0
        /// <summary>
        /// Asserts that an object has raised the <see cref="INotifyPropertyChanged.PropertyChanged"/> event for a particular property.
        /// </summary>
        /// <param name="eventSource">The object exposing the event.</param>
        /// <param name="propertyExpression">
        /// A lambda expression referring to the property for which the property changed event should have been raised, or
        /// <c>null</c> to refer to all properties.
        /// </param>
        /// <param name="because">
        /// A formatted phrase explaining why the assertion should be satisfied. If the phrase does not
        /// start with the word <i>because</i>, it is prepended to the message.
        /// </param>
        /// <param name="becauseArgs">
        /// Zero or more values to use for filling in any <see cref="string.Format(string,object[])"/> compatible placeholders.
        /// </param>
        /// <remarks>
        /// You must call <see cref="AssertionExtensions.MonitorEvents"/> on the same object prior to this call so that Fluent Assertions can
        /// subscribe for the events of the object.
        /// </remarks>
        public static IEventRecorder ShouldRaisePropertyChangeFor <T>(
            this T eventSource, Expression <Func <T, object> > propertyExpression,
            string because, params object[] becauseArgs)
        {
            IEventRecorder eventRecorder = EventMonitor.Get(eventSource).GetEventRecorder(PropertyChangedEventName);
            string         propertyName  = (propertyExpression != null) ? propertyExpression.GetPropertyInfo().Name : null;

            if (!eventRecorder.Any())
            {
                Execute.Assertion
                .BecauseOf(because, becauseArgs)
                .FailWith("Expected object {0} to raise event {1} for property {2}{reason}, but it did not.",
                          eventSource, PropertyChangedEventName, propertyName);
            }

            return(eventRecorder.WithArgs <PropertyChangedEventArgs>(args => args.PropertyName == propertyName));
        }
コード例 #26
0
        /// <summary>
        /// Asserts that all occurences of the event originated from the <param name="expectedSender"/>.
        /// </summary>
        public static IEventRecorder WithSender(this IEventRecorder eventRecorder, object expectedSender)
        {
            foreach (RecordedEvent recordedEvent in eventRecorder)
            {
                if (!recordedEvent.Parameters.Any())
                {
                    throw new ArgumentException(string.Format(
                                                    "Expected event from sender <{0}>, but event {1} does not include any arguments",
                                                    expectedSender, eventRecorder.EventName));
                }

                object actualSender = recordedEvent.Parameters.First();
                Execute.Assertion
                .ForCondition(ReferenceEquals(actualSender, expectedSender))
                .FailWith("Expected sender {0}, but found {1}.", expectedSender, actualSender);
            }

            return(eventRecorder);
        }
コード例 #27
0
 public TestClassFake(IEventRecorder record) : base(record)
 {
 }
コード例 #28
0
 protected TestClass(IEventRecorder eventRecorder)
 {
     _eventRecorder = eventRecorder;
 }
コード例 #29
0
ファイル: Sparrow.cs プロジェクト: darknews23/LifeGame
 public Sparrow(IMap map, IGrowable growable, IMovable movable, IEater eater, IGender gender,
                DeathEvent deathEvent, IEventRecorder eventRecorder)
     : base(map, growable, movable, eater, gender, deathEvent, eventRecorder)
 {
     Hp = 10;
 }
コード例 #30
0
ファイル: Creature.cs プロジェクト: darknews23/LifeGame
 protected Creature(IMap map, IGrowable growable, DeathEvent deathEvent, IEventRecorder eventRecorder) : base(map, deathEvent, eventRecorder)
 {
     CurrentAge = 0;
     _growable  = growable;
     _growable.GrowableOwner = this;
 }
コード例 #31
0
ファイル: MapGenerator.cs プロジェクト: darknews23/LifeGame
 public MapGenerator(IMap map, MapGenerationEvent mapGenerationEvent, IEventRecorder eventRecorder)
 {
     Map = map;
     _mapGenerationEvent = mapGenerationEvent;
     _eventRecorder      = eventRecorder;
 }