示例#1
0
        public void Place(IPlacement position)
        {
            _logger?.LogTrace($"Placed at: {position}");

            _currentPosition  = position.Location;
            _currentDirection = position.Orientation;
        }
示例#2
0
 public AccountController(UserManager <User> userManager, SignInManager <User> signInManager, IPlacement placement, IStatus status, IStatus statuss, IJobRole job)
 {
     this.signInManager = signInManager;
     this.userManager   = userManager;
     this.statuss       = statuss;
     this.placement     = placement;
     this.job           = job;
 }
 public bool PlaceCurrent()
 {
     if (_currentPlaceable.Place())
     {
         _currentPlaceable = null;
         return(true);
     }
     return(false);
 }
 public bool PickUp(IPlacement placeable, GameObject obj)
 {
     if (placeable.PickUp(obj))
     {
         _currentPlaceable = placeable;
         return(true);
     }
     return(false);
 }
        private void Purchase(GameObject mod)
        {
            GameObject newObjectPlacement = Instantiate(ObjectPlacementPrefab);
            GameObject newObject          = Instantiate(mod);

            IPlacement placement = newObjectPlacement.GetComponent <IPlacement>();

            PlacementController.PickUp(placement, newObject);
        }
示例#6
0
        public GatewayClientFactory(ILoggerFactory loggerFactory,
                                    IMessageCenter messageCenter,
                                    IPlacement placement,
                                    ClientConnectionPool clientPool
                                    )
        {
            this.logger               = loggerFactory.CreateLogger("GatewayClient");
            this.messageCenter        = messageCenter;
            this.placement            = placement;
            this.clientConnectionPool = clientPool;

            this.placement.RegisterServerChangedEvent(this.OnAddServer, this.OnRemoveServer, this.OnOfflineServer);
            this.placement.OnException(this.OnPDKeepAliveException);
        }
示例#7
0
        public GatewayMessageHandler(IServiceProvider serviceProvider,
                                     IMessageCenter messageCenter,
                                     ILoggerFactory loggerFactory,
                                     IConnectionManager sessionManager,
                                     IPlacement placement)

        {
            this.serviceProvider      = serviceProvider;
            this.logger               = loggerFactory.CreateLogger("MessageHandler");
            this.messageCenter        = messageCenter;
            this.sessionManager       = sessionManager;
            this.placement            = placement;
            this.clientConnectionPool = serviceProvider.GetService <ClientConnectionPool>();

            this.messageCenter.RegisterMessageProc(new BlockMessageCodec().CodecName, this.ProcessWebSocketMessage, false);
            this.messageCenter.RegisterDefaultMessageProc(this.ProcessDefaultMessage);
            this.RegisterHandler <ResponseAccountLogin>(this.ProcessResponseAccountLogin);
            this.RegisterHandler <RequestCloseSession>(this.ProcessRequestCloseSession);
            this.RegisterHandler <RequestSendMessageToSession>(this.ProcessRequestSendMessageToSession);
            this.RegisterHandler <RequestHeartBeat>(this.ProcessRequestHeartBeat);
            this.RegisterHandler <ResponseHeartBeat>(this.ProcessResponseHeartBeat);
        }
        public void Place(IPlacement position)
        {
            if (position == null)
            {
                return;
            }
            if (!_environment.CheckInBounds(position?.Location))
            {
                _logger?.LogTrace($"{position.Location} is out of bounds; command will be ignored");

                return;
            }
            else if (position?.Orientation == Direction.None)
            {
                _logger?.LogTrace("Placement must have an orientation; command will be ignored");

                return;
            }

            _innerRobot.Place(position);
            _hasBeenPlaced = true;
        }
 public PlaceCommand(IPlacement placement)
 {
     _placement = placement;
 }
示例#10
0
 public static ICommandBuilder <IRobot> Place(this ICommandBuilder <IRobot> builder, IPlacement placement)
 => builder.Add(new PlaceCommand(placement));
示例#11
0
 public void TakePlacement(IPlacement placement)
 {
     CancelAll();
     placement.Init();
     GetBehaviour(placement.GetType()).TakePlacement(placement);
 }
 public PlacementController(IPlacement placement)
 {
     this.placement = placement;
 }
 public void TakePlacement(IPlacement placement)
 {
     TakePlacement((T)placement);
 }