Exemple #1
0
        string LookAtObjectCommand(Command lookAtCommand, Game game)
        {
            string objectString = lookAtCommand.GetParameter("object");

            Objects.ID objectType = Emoji.GetID(objectString);

            if (objectType == Objects.ID.Unknown)
            {
                mStatus = Status.Frustrated;
                return("You can't even figure out what that is.");
            }

            GridObject targetObject = game.mRoom.GetNearestObject(objectType, mPosition);

            if (targetObject == null)
            {
                if (game.mInventory.Contains(objectType))
                {
                    mStatus = Status.Thinking;
                    return(ObjectTraits.GetObjectTraits(objectType).GetDescription(game));
                }
                else
                {
                    mStatus = Status.Frustrated;
                    return("You don't see that here.");
                }
            }
            else
            {
                mStatus = Status.Thinking;
                return(targetObject.GetDescriptionText(game));
            }
        }
Exemple #2
0
        string HandleInspectDirectionCommand(Command inspectCommand, Game game)
        {
            string directionString = inspectCommand.GetParameter("direction");

            Direction direction = Room.GetDirection(directionString);

            if (direction == Direction.Unknown)
            {
                return("Invalid direction");
            }

            Point inspectPosition = MathUtils.GetAdjacentPoint(mPosition, direction);

            GridObject inspectObject = game.mRoom.GetFirstObject(inspectPosition);

            mStatus = Status.Thinking;

            return(inspectObject.GetDescriptionText(game));
        }