Пример #1
0
        public Task<Option<IPlayer>> RequestAvailablePlayerAsync(IRoom room)
        {
            var player = players.Values.FirstOrDefault(p => !p.CurrentRoom.HasValue);
            player?.AssignToRoom(room);

            return Task.FromResult(Option.Create((IPlayer)player));
        }
Пример #2
0
        public static PostHandlerOutput[] OOCMessage(
            IDocumentSession documentSession,
            IMember sender,
            IRoom room,
            string source)
        {
            documentSession.Ensure("documentSession");
            sender.Ensure("sender");
            room.Ensure("room");
            source.Ensure("source");

            var match = oocMessageRegex.Match(source);
            if (!match.Success)
                return null;

            var message = match.Groups[1].Value;

            var text = string.Concat(
                "(( ",
                sender.Alias,
                ": ",
                message,
                " ))");

            documentSession.CreatePost(room.Id, sender.Id, sender.EmailAddress.GravatarUrl(), source, "ooc-message", text);

            return PostHandlerOutput.Empty;
        }
Пример #3
0
 public void updateCurrentRoom(IRoom model)
 {
     if (currentRoom)
         Destroy(currentRoom.gameObject);
     currentRoom = makeCurrent(model);
     currentRoom.roomeEnabled = true;
 }
Пример #4
0
        public static bool IsRoomPlayer(this IMember member, IRoom room)
        {
            room.Ensure("room");
            member.Ensure("member");

            return room.Players.Any(player => player.MemberId == member.Id);
        }
Пример #5
0
		private void onSavedGameLoaded()
		{
			_player = _game.State.Player;
			_room = Rooms.Find(_game.State, _room);
			_bottle = _room.Find<IObject>(_bottleId);
			subscribeEvents();
		}
Пример #6
0
        public static PostHandlerOutput[] HandlePost(
            IDocumentSession documentSession,
            IMember sender,
            IRoom room,
            string source)
        {
            documentSession.Ensure("documentSession");
            sender.Ensure("sender");
            room.Ensure("room");
            source.Ensure("source");

            if (_postHandlers == null)
                throw new InvalidOperationException("Post handlers haven't been set yet.");

            if (!CanPost(room, sender))
            {
                throw new InvalidOperationException(
                    String.Format(
                        CultureInfo.InvariantCulture,
                        "Member '{0}' cannot post to room '{1}'.",
                        sender.Id,
                        room.Id));
            }

            return _postHandlers
                .Select(slashCommand => slashCommand(
                    documentSession,
                    sender,
                    room,
                    source))
                .FirstOrDefault(result => result != null);
        }
Пример #7
0
        public static void NotifyRoom(IRoom room, IPost post, IMailSender mailSender)
        {
            var context = GlobalHost.ConnectionManager.GetHubContext<RoomHub>();

            context.Clients.Group(String.Concat("room-", post.RoomId))
                .post(post.Id, post.Type, post.AuthorAlias, post.AvatarUrl, post.Text, post.Timestamp.ToString("MMM dd yy @ hh:mm tt"));

            IEnumerable<string> emailAddresses;
            if (post.AuthorId == room.OwnerId)
                emailAddresses = room.Players.Select(x => x.MemberEmailAddress);
            else
                emailAddresses =
                    room.Players
                        .Where(x => x.MemberId != post.AuthorId)
                        .Select(x => x.MemberEmailAddress)
                        .Concat(new[] { room.OwnerEmailAddress });

            var subject = String.Concat("[", room.Slug, "] ", "New Post");
            const string bodyFormat = @"There's a new post to {0}:

            {1}

            Visit the room at {2}.";
            var body = String.Format(CultureInfo.CurrentUICulture, bodyFormat, room.Title, post.Text, MakeAbsoluteUri(Paths.Room(room.Slug)));

            emailAddresses.ForEach(x => SendMail(x, subject, body));
        }
Пример #8
0
        public static PostHandlerOutput[] RollCommand(
            IDocumentSession documentSession,
            IMember sender,
            IRoom room,
            string source)
        {
            documentSession.Ensure("documentSession");
            sender.Ensure("sender");
            room.Ensure("room");
            source.Ensure("source");

            var match = rollCommandRegex.Match(source);
            if (!match.Success)
                return null;

            var number = int.Parse(match.Groups[1].Value);
            var sides = int.Parse(match.Groups[2].Value);

            var diceRolled = string.Join(
                ", ",
                fn.RollDice(number, sides).ToArray());

            var text = string.Format(
                CultureInfo.CurrentUICulture,
                "{0} rolled {1}d{2} with the result: {3}.",
                sender.Alias,
                number,
                sides,
                diceRolled);

            documentSession.CreatePost(room.Id, sender.Id, null, source, "roll-result", text);

            return PostHandlerOutput.Empty;
        }
Пример #9
0
        public static PostHandlerOutput[] GMNarration(
            IDocumentSession documentSession,
            IMember sender,
            IRoom room,
            string source)
        {
            documentSession.Ensure("documentSession");
            sender.Ensure("sender");
            room.Ensure("room");
            source.Ensure("source");

            if (!sender.IsRoomOwner(room))
                return null;

            source = source.Trim();

            if (source.StartsWith("/", StringComparison.OrdinalIgnoreCase))
                return null;

            var text = string.Concat(
                "GM: ",
                source);

            documentSession.CreatePost(room.Id, sender.Id, null, source, "gm-narration", text);

            return PostHandlerOutput.Empty;
        }
Пример #10
0
        public static bool IsRoomOwner(this IMember member, IRoom room)
        {
            room.Ensure("room");
            member.Ensure("member");

            return room.OwnerId == member.Id;
        }
Пример #11
0
    public TranscriptViewModel(IRoom room, ISite site, string searchTerm, 
      DateTime searchDate, MessageViewModelFactory messageViewModelFactory, IEventAggregator eventAggregator)
    {
      this.room = room;
      this.site = site;

      this.SearchTerm = searchTerm;
      this.SearchDate = searchDate;

      this.dispatcher = Dispatcher.CurrentDispatcher;

      this.messageViewModelFactory = messageViewModelFactory;
      this.Messages = new ObservableCollection<ViewModelBase>();
      this.Rooms = new ObservableCollection<RoomViewModel>();

      if (!string.IsNullOrWhiteSpace(this.SearchTerm))
        SearchByString();
      else if (this.SearchDate != DateTime.MinValue)
        SearchByDate();

      if (SearchDate == DateTime.MinValue)
        SearchDate = DateTime.Today;

      this.SearchByStringCommand = new RelayCommand(SearchByString);
      this.SearchByDateCommand = new RelayCommand(SearchByDate);

      foreach (var r in this.site.Rooms)
        this.Rooms.Add(new RoomViewModel(site, null, r, eventAggregator));
    }
Пример #12
0
        public static PostHandlerOutput[] PCNarration(
            IDocumentSession documentSession,
            IMember sender,
            IRoom room,
            string source)
        {
            documentSession.Ensure("documentSession");
            sender.Ensure("sender");
            room.Ensure("room");
            source.Ensure("source");

            source = source.Trim();
            if (source.StartsWith("/", StringComparison.OrdinalIgnoreCase))
                return null;

            if (!sender.IsRoomPlayer(room))
                return null;

            var player = room.Players.SingleOrDefault(x => x.MemberId == sender.Id);
            if (player == null)
                return null;

            var text = string.Concat(
                player.CharacterName,
                ": ",
                source);

            documentSession.CreatePost(room.Id, sender.Id, null, source, "pc-narration", text);

            return PostHandlerOutput.Empty;
        }
        public IOperationResult<IRoomUser> JoinRoom(IUserSession session, IRoom room)
        {
            Contract.Requires(room != null, "room is null.");
            Contract.Requires(session != null, "session is null.");
            Contract.Ensures(Contract.Result<IOperationResult<IRoomUser>>() != null);

            return default(IOperationResult<IRoomUser>);
        }
        /// <summary>
        /// Joins the room.
        /// </summary>
        /// <param name="session">The session.</param>
        /// <param name="room">The room.</param>
        /// <returns></returns>
        /// Permite a un usuario en sesión ingresar a una sala,
        /// si el usuario en sesión no está autentificado, se lanzará una
        /// excepción de seguridad
        /// *
        /// <remarks>TODO: Pruebas unitarias para este método.</remarks>
        public IOperationResult<IRoomUser> JoinRoom(IUserSession session, IRoom room)
        {
            RoomUser rUser = new RoomUser(session, room);
              this.roomsUserLists[room].Add(rUser);
              messaging.Publish(room, Tuple.Create(session, RoomAction.Join));

              return new OperationResult<IRoomUser>(ResultValue.Success, "", rUser);
        }
Пример #15
0
 public UserManager(IRoom room)
 {
     mRoom = (Room)room;
     mSocketHander = mRoom.SocketHander;
     mSocketHander.AddListener(this, ENUM_SOCKET_EVENT.EVENT_MESSAGE, OnUserEnterEvent, (ushort)MAIN_CMD.MDM_GR_USER, (ushort)USER_SUB_CMD.SUB_GR_USER_ENTER, typeof(tagUserInfo));
     mSocketHander.AddListener(this, ENUM_SOCKET_EVENT.EVENT_MESSAGE, OnUserStatusEvent, (ushort)MAIN_CMD.MDM_GR_USER, (ushort)USER_SUB_CMD.SUB_GR_USER_STATUS, typeof(CMD_GR_UserStatus));
     mSocketHander.AddListener(this, ENUM_SOCKET_EVENT.EVENT_MESSAGE, OnUserScoreEvent, (ushort)MAIN_CMD.MDM_GR_USER, (ushort)USER_SUB_CMD.SUB_GR_USER_SCORE, typeof(CMD_GR_UserScore));
 }
Пример #16
0
        public async Task<IDoorway> CreateDoor(string doorwayName, IRoom departureRoom, ITravelDirection travelDirection)
        {
            var doorway = new MudDoor();
            await doorway.ConnectRoom(travelDirection, departureRoom);
            doorway.SetName(doorwayName);

            return doorway;
        }
Пример #17
0
        public void changeRoom(Dir direction)
        {
            if (currentRoom != null)
                currentRoom.teardown();

            var newPos = currentRoom.pos + Positions.fromDir(direction);
            currentRoom = getRoomFromPos(newPos);
        }
Пример #18
0
			public RoomCrossFader(RoomMusicCrossFading crossFading, IRoom room)
			{
				_crossFading = crossFading;
				Room = room;

				room.Events.OnBeforeFadeOut.Subscribe(onBeforeFadeOut);
				room.Events.OnBeforeFadeIn.Subscribe(onBeforeFadeIn);
			}
Пример #19
0
 private void TypeRemoved(string type)
 {
     if (type == _roomType && _room != null)
     {
         _room.Dispose();
         _room = null;
     }
 }
 public void Render(IRoom room)
 {
     for (int i = 0; i < room.Length; i++)
     {
         for(int j = 0; j < room.Length; j++)
             Console.WriteLine("a");
     }
 }
Пример #21
0
        public PluginRoom(string type)
        {
            _roomType = type;
            _parent = new Room();
            _room = Program.RoomFactory.Create(_roomType, _parent);

            Program.RoomFactory.Added += TypeAdded;
            Program.RoomFactory.Removed += TypeRemoved;
        }
Пример #22
0
        //called from the LOOK command
        private static string DisplayPlayersInRoom(IRoom room, ObjectId ignoreId) {
            StringBuilder sb = new StringBuilder();

            if (!room.IsDark) {
                foreach (var id in room.GetObjectsInRoom(RoomObjects.Players)) {
                    if (!id.Equals(ignoreId)) {
                        IUser otherUser = Server.GetAUser(id);
                        if (otherUser != null && otherUser.CurrentState == UserState.TALKING) {
                            if (otherUser.Player.ActionState != CharacterActionState.Hiding && otherUser.Player.ActionState != CharacterActionState.Sneaking){  //(string.IsNullOrEmpty(PassesHideCheck(otherUser, ignoreId, out spot))) { //player should do a spot check this should not be a given
                                sb.AppendLine(otherUser.Player.FirstName + " is " + otherUser.Player.StanceState.ToString().ToLower() + " here.");
                            }  
                        }
                    }
                }
                Dictionary<string, int> npcGroups = new Dictionary<string, int>();

                foreach (var id in room.GetObjectsInRoom(RoomObjects.Npcs)) {
                    var npc = Character.NPCUtils.GetAnNPCByID(id);

                    if (!npcGroups.ContainsKey(npc.FirstName + "$" + npc.LastName + "$" + npc.StanceState)) {
                        npcGroups.Add(npc.FirstName + "$" + npc.LastName + "$" + npc.StanceState, 1);
                    }
                    else {
                        npcGroups[npc.FirstName + "$" + npc.LastName + "$" + npc.StanceState] += 1;
                    }
                }

                foreach (KeyValuePair<string, int> pair in npcGroups) {
                    string[] temp = pair.Key.Split('$');
                    sb.AppendLine(temp[0] + " is " + temp[2].Replace("_", " ").ToLower() + " here. " + (pair.Value > 1 ? ("[x" + pair.Value + "]") : ""));
                }
            }
            else {
                int count = 0;
                foreach (var id in room.GetObjectsInRoom(RoomObjects.Players)) {
                    if (!id.Equals(ignoreId)) {
                        IUser otherUser = Server.GetAUser(id);
                        if (otherUser != null && otherUser.CurrentState == UserState.TALKING) {
                            if (otherUser.Player.ActionState != CharacterActionState.Hiding && otherUser.Player.ActionState != CharacterActionState.Sneaking) {  //player should do a spot check this should not be a given
                                count++;
                            }
                        }
                    }
                }
                count += room.GetObjectsInRoom(RoomObjects.Npcs).Count;

                if (count == 1) {
                    sb.AppendLine("A presence is here.");
                }
                else if (count > 1) {
                    sb.AppendLine("Several presences are here.");
                }
            }

            return sb.ToString();
        }
Пример #23
0
        private static void addWalls(GameObject room, IRoom model)
        {
            addCeiling(room, model.walls[0]);
            addFloor(room, model.walls[2]);

            if (model.walls[1])
                addRightWall(room);
            if (model.walls[3])
                addLeftWall(room);
        }
Пример #24
0
        public TableManager(IRoom room)
        {
            mRoom = (Room)room;
            mSocketHander = mRoom.SocketHander;

            //桌子信息
            mSocketHander.AddListener(this, ENUM_SOCKET_EVENT.EVENT_MESSAGE, OnTableStatusEvent, (ushort)MAIN_CMD.MDM_GR_STATUS, (ushort)STATUS_SUB_CMD.SUB_GR_TABLE_STATUS, typeof(CMD_GR_TableStatus));
            mSocketHander.AddListener(this, ENUM_SOCKET_EVENT.EVENT_MESSAGE, OnTableInfoEvent, (ushort)MAIN_CMD.MDM_GR_STATUS, (ushort)STATUS_SUB_CMD.SUB_GR_TABLE_INFO, typeof(CMD_GR_TableInfo));
            mSocketHander.AddListener(this, ENUM_SOCKET_EVENT.EVENT_MESSAGE, OnSystemMessageEvent, (ushort)MAIN_CMD.MDM_CM_SYSTEM, (ushort)SYSTEM_SUB_CMD.SUB_CM_SYSTEM_MESSAGE, typeof(CMD_CM_SystemMessage));
        }
Пример #25
0
 public Guid AddRoom(IRoom room)
 {
     var command = new AddRoomCommand(room);
     var result = _processor.ProcessCommand(command);
     if (result.EventsWereEmitted)
     {
         return command.CreatedGuid;
     }
     throw new CreationFailedException(command.CreatedGuid, typeof (IRoom));
 }
Пример #26
0
		public TreeNode(IRoom room) {
			if (room != null) {
				ID = room.Id;
				Zone = room.Zone;
				Number = room.RoomId;
				AdjacentNodes = new Dictionary<string, TreeNode>();
				Title = room.Title;
				Traversable = !room.GetRoomType().HasFlag(RoomTypes.DEADLY); //more work to be done here
			}
		}
Пример #27
0
        public TrackStarted(IRoom room, ITrack track)
        {
            if (room == null)
                throw new ArgumentNullException(nameof(room));
            if (track == null)
                throw new ArgumentNullException(nameof(track));

            TrackId = track.Id;
            RoomId = room.Id;
        }
Пример #28
0
        public static PostHandlerOutput[] InvitationsCommand(
            IDocumentSession documentSession,
            IMember sender,
            IRoom room,
            string source)
        {
            documentSession.Ensure("documentSession");
            sender.Ensure("sender");
            room.Ensure("sender");
            source.Ensure("source");

            var match = invitationsRegex.Match(source);
            if (!match.Success)
                return null;

            if (!sender.IsRoomOwner(room))
                return new[]
                {
                    new PostHandlerOutput
                    {
                        message = "Only the room's owner can view unused invitations.",
                        type= "error"
                    }
                };

            var invitations = documentSession.GetInvitationsByRoom(room.Id)
                .ToArray();

            if (invitations.Length == 0)
                return new[]
                {
                    new PostHandlerOutput
                    {
                        message = "There are no unused invitations.",
                        type = "system"
                    }
                };

            var buffer = new StringBuilder();
            buffer.AppendLine("Unused invitations:");
            foreach (var invitation in invitations)
            {
                buffer.AppendFormat("- {0}?invitation-code={1}", fn.MakeAbsoluteUri(Paths.AcceptInvitationForm()), invitation.Code);
                buffer.AppendLine();
            }

            return new[]
            {
                new PostHandlerOutput
                {
                    message = buffer.ToString(),
                    type = "system"
                }
            };
        }
Пример #29
0
        public PasteViewModel(ClipboardItem clipboardItem, IRoom room, IMessageBus bus)
        {
            if (clipboardItem.IsImage)
            {
                _imageSource = clipboardItem.LocalPath;
            }
            else
            {
                _imageSource = DependencyProperty.UnsetValue;
            }

            Caption = "Upload this " + (clipboardItem.IsImage ? "image" : "file") + "?";
            LocalPath = clipboardItem.LocalPath;
            ShowLocalPath = !clipboardItem.IsImage;
            ContentType = clipboardItem.ContentType;
            Size = clipboardItem.Size;

            PasteCommand = new ReactiveCommand();

            Subscribe(bus.Listen<FileUploadedMessage>().Where(msg => msg.CorrelationId == _currentCorrelation)
                .SubscribeUI(_ => IsFinished = true));

            Subscribe(bus.Listen<FileUploadProgressChangedMessage>().Where(msg => msg.CorrelationId == _currentCorrelation)
                .SubscribeUI(
                    msg =>
                    {
                        ProgressCurrent = msg.Progress.Current;
                        ProgressTotal = msg.Progress.Total;
                        Debug.WriteLine("Current, total" + ProgressCurrent + ", " + ProgressTotal);
                    }));

            Subscribe(bus.Listen<CorrelatedExceptionMessage>().Where(msg => msg.CorrelationId == _currentCorrelation)
                .SubscribeUI(msg =>
                    {
                        IsErrored = true;
                        IsUploading = false;
                        LastException = msg.Exception;
                    }));

            ProgressCurrent = 0;
            ProgressTotal = 100;

            Subscribe(bus.RegisterMessageSource(
                PasteCommand.Do(_ =>
                    {
                        IsUploading = true;
                        IsErrored = false;
                    })
                .Select(_ => new RequestUploadFileMessage(room.Id, clipboardItem.LocalPath, clipboardItem.ContentType))
                .Do(msg => _currentCorrelation = msg.CorrelationId)));

            CancelCommand = new ReactiveCommand();
            Subscribe(CancelCommand.Subscribe(_ => IsFinished = true));
        }
Пример #30
0
        public void Dispose()
        {
            if (_room != null)
            {
                _room.Dispose();
                _room = null;
            }

            Program.RoomFactory.Added -= TypeAdded;
            Program.RoomFactory.Removed -= TypeRemoved;
        }
Пример #31
0
 private ITreeStringNode findRoom(IRoom room)
 {
     return(_moreRoomsNode.TreeNode.Children.FirstOrDefault(c => c.Text.EndsWith(room.ID, StringComparison.InvariantCulture))
            ?? _treeView.Tree.TreeNode.Children.FirstOrDefault(c => c.Text.EndsWith(room.ID, StringComparison.InvariantCulture)));
 }
        public async Task <ICalendarEvent> CreateFromOccurenceAsync(Occurrence occurrence, IRoom room)
        {
            LogOccurence(occurrence);
            var calendarEvent  = (CalendarEvent)occurrence.Source;
            var isPrivateEvent = IsPrivateEvent(calendarEvent);
            var eventId        = $"{calendarEvent.Uid}-{occurrence.Period}";
            var subject        = room.ShowSubject ? calendarEvent.Summary : string.Empty;

            var user = isPrivateEvent
                ? new PrivateEventUser()
                : await GetUser(calendarEvent);

            var eventOccurence = new IcalCalendarEventOccurence(occurrence, isPrivateEvent, room.ShowSubject);
            var chatInfo       = await _chatService.GetChatInfoAsync(user, eventOccurence);

            return(new RoomieCalendarEvent(user, eventOccurence, chatInfo));
        }
Пример #33
0
 public Task ChangeRoomAsync(IRoom room, Nullable <Single> x, Nullable <Single> y)
 {
     return(_hasRoom.ChangeRoomAsync(room, x, y));
 }
Пример #34
0
 public DoorNeedingSpell(IRoom room1, IRoom room2) : base(room1, room2)
 {
 }
Пример #35
0
        public void RemoveRoom(IRoom room2remove)
        {
            IManagerRoomOwner mO = Owner as IManagerRoomOwner;

            mO.RemoveRoom(room2remove);
        }
 public void setRoomManager(GameObject managerObject)
 {
     roomManager = managerObject.GetComponent <IRoom>();
 }
Пример #37
0
 public RoomId(IRoom room) : base(room.Zone, room.Id)
 {
 }
Пример #38
0
 public static IRoom Find(IGameState state, IRoom oldRoom)
 {
     return(state.Rooms.First(r => r.ID == oldRoom.ID));
 }
Пример #39
0
 private static Direction CommonWall(IRoom room1, IRoom room2)
 {
     throw new NotImplementedException();
 }
Пример #40
0
 private RoomView makeCurrent(IRoom model)
 {
     return(RoomFactory.makeRoom(model, transform));
 }
Пример #41
0
        public ICommand GetCommand()
        {
            var File = new FileIO();

            if (connectedPlayer.Location == null)
            {
                string   startRoom = EngineSettings.Default.InitialRoom;
                string[] locations = startRoom.Split('>');

                if (locations.Length < 3)
                {
                    Log.Error("The Server does not have a starting room set!");
                    connectedPlayer.SendMessage(
                        "The server does not have a starting room set! Please contact the server administrator.");
                    return(new NoOpCommand());
                }

                IWorld world = director.Server.Game.World;

                if (world == null)
                {
                    Log.Fatal("Failed to get a instance of the game world!");
                    return(new NoOpCommand()); //If this is null, then we should end up in a infinite console spam
                }

                IRealm realm = world.GetRealm(locations[0]);
                if (realm == null)
                {
                    Log.Fatal(string.Format("Failed to load Realm {0}", locations[0]));
                    return(new NoOpCommand());
                }

                IZone zone = realm.GetZone(locations[1]);
                if (zone == null)
                {
                    Log.Fatal(string.Format("Failed to load Zone {0}", locations[1]));
                    return(new NoOpCommand());
                }

                IRoom room = zone.GetRoom(locations[2]);
                if (room == null)
                {
                    Log.Fatal(string.Format("Failed to load Room {0}", locations[2]));
                    return(new NoOpCommand());
                }

                connectedPlayer.Move(room);

                File.Save(connectedPlayer, Path.Combine(EngineSettings.Default.PlayerSavePath, string.Format("{0}.char", connectedPlayer.Username)));
            }
            else if (connectedPlayer.Director.Server.Game.World.RoomExists(connectedPlayer.Location.ToString()))
            {
                File.Save(connectedPlayer, Path.Combine(EngineSettings.Default.PlayerSavePath, string.Format("{0}.char", connectedPlayer.Username)));
            }
            else
            {
                //Set as null and re-run through this state again.
                connectedPlayer.Location = null;
                return(new NoOpCommand()); //Dont allow it to finish the setup
            }

            return(SetupDefaultState());
        }
Пример #42
0
        public virtual bool IsEmbeddedInRoom(IRoom room, bool recurse = false)
        {
            Debug.Assert(room != null);

            return(IsEmbeddedInRoomUid(room.Uid, recurse));
        }
Пример #43
0
        /// <summary>
        /// Creates an uninitialized instance of a doorway, connected to a departing and arrival room.
        /// A doorway will be created for both rooms, linking them together from both ends
        /// </summary>
        /// <param name="arrivalRoom">The room that an IActor would be arriving into during travel.</param>
        /// <param name="departureRoom">The room that an IActor would be departing from.</param>
        /// <param name="travelDirection">The direction need to travel in order to leave the departure room.</param>
        /// <returns>Returns an uninitialized doorway</returns>
        public async Task <IDoorway> CreateTwoWayDoor(string doorwayName, IRoom arrivalRoom, IRoom departureRoom, ITravelDirection travelDirection)
        {
            var doorway = new MudDoor();
            await doorway.ConnectRooms(travelDirection, departureRoom, arrivalRoom, true);

            return(doorway);
        }
Пример #44
0
 public RoomsController(IRoom room)
 {
     _room = room;
 }
Пример #45
0
        public void UseItem(IPlayer player, IRoom room)
        {
            ICommand itemCommand = new LinkUseMagicBoomerangCommand(player, room);

            itemCommand.Execute();
        }
Пример #46
0
 public void AddExit(string direction, IRoom room)
 {
     Exits.Add(direction, room);
 }
Пример #47
0
        public virtual void SetEmbeddedInRoom(IRoom room)
        {
            Debug.Assert(room != null);

            SetEmbeddedInRoomUid(room.Uid);
        }
Пример #48
0
        public string GetSignature(IRoom room, string input)
        {
            var dataBytes = Encoding.UTF8.GetBytes(BuildInput(room, input));

            return(Convert.ToBase64String(_crypto.SignData(dataBytes, new SHA256Managed())));
        }
Пример #49
0
        public virtual bool IsCarriedByContainerContainerTypeExposedToRoom(IRoom room, bool recurse = false)
        {
            Debug.Assert(room != null);

            return(IsCarriedByContainerContainerTypeExposedToRoomUid(room.Uid, recurse));
        }
Пример #50
0
 private string BuildInput(IRoom room, string input)
 {
     return($"{room.Id}_{input}");
 }
Пример #51
0
 public DisappearingTrap(ILocation location, int damage) :
     base(new RoomObject(location.X, location.Y), damage)
 {
     _room = location.Room;
 }
Пример #52
0
 public void UseItem(IPlayer player, IRoom room)
 {
     //TODO
 }
Пример #53
0
 static void AddRoom(IRoom newRoom)
 {
     m_rooms.Add(newRoom);
 }
 public ProjectileBlockTrigger(IProjectile projectile, IRoom room)
 {
     this.currentRoom = room;
     this.projectile  = projectile;
 }
Пример #55
0
 public FreeGameRuleSystem(IRoom room)
 {
     _room = room;
 }
Пример #56
0
 private void RemoveRoom(IRoom room)
 {
     ManagerRoom.RemoveRoom(room);
 }
Пример #57
0
 internal EntityHandler(IRoom room)
 {
     Entities      = new Dictionary <int, BaseEntity>();
     _entityCycler = new EntityCycler(room);
 }
Пример #58
0
 public bool CheckIn(IRoom room, IBooking booking)
 {
     DataLayer.CheckInDB(room, booking);
     return(true);
 }
Пример #59
0
 public void AddRoom(IRoom room)
 {
     AddRoom(room, room.XOffset, room.YOffset);
 }
Пример #60
0
 public override IRoom OtherSideFrom(IRoom room)
 {
     throw new System.NotImplementedException();
 }