Exemple #1
0
 public Actor([NotNull] IPerson person, [NotNull] IActorTaskSource <ISectorTaskSourceContext> taskSource,
              [NotNull] IGraphNode node)
 {
     Person     = person ?? throw new ArgumentNullException(nameof(person));
     TaskSource = taskSource ?? throw new ArgumentNullException(nameof(taskSource));
     Node       = node ?? throw new ArgumentNullException(nameof(node));
 }
Exemple #2
0
 public Actor([NotNull] IPerson person, [NotNull] IActorTaskSource <ISectorTaskSourceContext> taskSource,
              [NotNull] IGraphNode node)
 {
     Person     = person;
     TaskSource = taskSource;
     Node       = node;
 }
        private static IActor CreateMonster(IActorManager actorManager, MonsterPerson person, IGraphNode startNode,
                                            IActorTaskSource <ISectorTaskSourceContext> actorTaskSource)
        {
            var actor = new Actor(person, actorTaskSource, startNode);

            actorManager.Add(actor);
            return(actor);
        }
        public SwitchHumanActorTaskSource(IHumanActorTaskSource <TContext> humanActorTaskSource,
                                          IActorTaskSource <TContext> botActorTaskContext)
        {
            _humanActorTaskSource =
                humanActorTaskSource ?? throw new ArgumentNullException(nameof(humanActorTaskSource));
            _botActorTaskContext = botActorTaskContext ?? throw new ArgumentNullException(nameof(botActorTaskContext));

            CurrentControl = ActorTaskSourceControl.Human;
        }
        private IActor CreateMonster(IActorManager actorManager, IMonsterScheme monsterScheme, IGraphNode startNode,
                                     IActorTaskSource <ISectorTaskSourceContext> actorTaskSource)
        {
            var person = _monsterFactory.Create(monsterScheme);
            var actor  = new Actor(person, actorTaskSource, startNode);

            actorManager.Add(actor);
            return(actor);
        }
Exemple #6
0
        private static bool IsPlayerActorControlledByHuman(IActorTaskSource <ISectorTaskSourceContext> taskSource)
        {
            if (taskSource is IActorTaskControlSwitcher controlSwitcher)
            {
                return(controlSwitcher.CurrentControl == ActorTaskSourceControl.Human);
            }

            return(true);
        }
Exemple #7
0
        public TaskState(IActor actor, IActorTask task, IActorTaskSource taskSource)
        {
            Actor      = actor ?? throw new ArgumentNullException(nameof(actor));
            Task       = task ?? throw new ArgumentNullException(nameof(task));
            TaskSource = taskSource ?? throw new ArgumentNullException(nameof(taskSource));

            Counter         = Task.Cost;
            _valueToExecute = Task.Cost / 2;
        }
Exemple #8
0
        private static IActor CreateActor(
            IPerson humanPerson,
            IGraphNode startNode,
            IActorTaskSource <ISectorTaskSourceContext> actorTaskSource)
        {
            var actor = new Actor(humanPerson, actorTaskSource, startNode);

            return(actor);
        }
 public TransitionPoolItem(IPerson person, IActorTaskSource <ISectorTaskSourceContext> actorTaskSource,
                           ISector nextSector, ISector oldSector, IGraphNode oldNode)
 {
     Person     = person ?? throw new ArgumentNullException(nameof(person));
     TaskSource = actorTaskSource ?? throw new ArgumentNullException(nameof(actorTaskSource));
     NextSector = nextSector ?? throw new ArgumentNullException(nameof(nextSector));
     OldSector  = oldSector ?? throw new ArgumentNullException(nameof(oldSector));
     OldNode    = oldNode ?? throw new ArgumentNullException(nameof(oldNode));
 }
 /// <summary>
 /// Создаёт экземпляр <see cref="MonsterGenerator" />.
 /// </summary>
 /// <param name="schemeService"> Сервис схем. </param>
 /// <param name="generatorRandomSource"> Источник рандома для генератора. </param>
 public MonsterGenerator(ISchemeService schemeService,
                         IMonsterPersonFactory monsterFactory,
                         IMonsterGeneratorRandomSource generatorRandomSource,
                         IActorTaskSource <ISectorTaskSourceContext> actorTaskSource)
 {
     _schemeService         = schemeService ?? throw new ArgumentNullException(nameof(schemeService));
     _monsterFactory        = monsterFactory ?? throw new ArgumentNullException(nameof(monsterFactory));
     _generatorRandomSource =
         generatorRandomSource ?? throw new ArgumentNullException(nameof(generatorRandomSource));
     _actorTaskSource = actorTaskSource;
 }
Exemple #11
0
 public NationalUnityEventService(
     IPersonFactory personFactory,
     IDice dice,
     IActorTaskSource <ISectorTaskSourceContext> actorTaskSource,
     IUserTimeProvider userTimeProvider)
 {
     _personFactory    = personFactory;
     _dice             = dice;
     _actorTaskSource  = actorTaskSource;
     _userTimeProvider = userTimeProvider;
 }
Exemple #12
0
 public GlobeInitializer(
     IBiomeInitializer biomeInitializer,
     IGlobeTransitionHandler globeTransitionHandler,
     ISchemeService schemeService,
     IActorTaskSource <ISectorTaskSourceContext> actorTaskSource,
     IPersonInitializer personInitializer)
 {
     _biomeInitializer       = biomeInitializer;
     _globeTransitionHandler = globeTransitionHandler;
     _schemeService          = schemeService;
     _actorTaskSource        = actorTaskSource;
     _personInitializer      = personInitializer;
 }
 public ActorTaskExecutionException(IActorTaskSource actorTaskSource)
 {
     ActorTaskSource = actorTaskSource;
 }
 public ActorTaskExecutionException(string message, IActorTaskSource actorTaskSource, Exception inner) : base(message, inner)
 {
     ActorTaskSource = actorTaskSource;
 }
Exemple #15
0
 public OnlyBotTaskSourceCollector([Inject(Id = "monster")] IActorTaskSource <ISectorTaskSourceContext> botActorTaskSource)
 {
     _botActorTaskSource = botActorTaskSource;
 }
Exemple #16
0
 public void SwitchTaskSource(IActorTaskSource <ISectorTaskSourceContext> actorTaskSource)
 {
     TaskSource = actorTaskSource;
 }
Exemple #17
0
 public Actor([NotNull] IPerson person, [NotNull] IActorTaskSource <ISectorTaskSourceContext> taskSource,
              [NotNull] IGraphNode node,
              IPerkResolver?perkResolver) : this(person, taskSource, node)
 {
     _perkResolver = perkResolver;
 }
Exemple #18
0
 public ActorTaskExecutionException(IActorTaskSource <ISectorTaskSourceContext> actorTaskSource)
 {
     ActorTaskSource = actorTaskSource;
 }
Exemple #19
0
 public ActorTaskExecutionException(string message, IActorTaskSource <ISectorTaskSourceContext> actorTaskSource) :
     base(message)
 {
     ActorTaskSource = actorTaskSource;
 }