示例#1
0
        public void MoveAllPartyMembersToLocation(string roomIDToMoveTo, string leavingMethod, string enteringMethod, bool processResponses = true)
        {
            // See if the person being invited exists in memory
            List <SMCharacter> characterList = (List <SMCharacter>)HttpContext.Current.Application["SMCharacters"];

            SMRoom smr = new SlackMud().GetRoom(roomIDToMoveTo);

            // Scroll through the party members
            foreach (SMPartyMember smpmToMove in this.PartyMembers)
            {
                // See if the person being invited exists in memory
                SMCharacter smc = characterList.FirstOrDefault(ch => ch.GetFullName() == smpmToMove.CharacterName);

                if (smc != null)
                {
                    // Move the player.
                    smc.ActualMove(smr, leavingMethod, enteringMethod, processResponses);

                    // Save the player move.
                    smc.SaveToApplication();
                }
            }
        }