using System;
namespace Holo.Virtual.Users
{
///
/// Represents a virtual user in a virtual room.
///
public class virtualRoomUser
{
///
/// The database ID of the user.
///
internal int userID;
///
/// The ID of the user in the virtual room.
///
internal int roomUID;
///
/// The X position of the user in the virtual room.
///
internal int x;
internal int lastX;
internal int X
{
get
{
return x;
}
set
{
lastX = x;
x = value;
}
}
///
/// The Y position of the user in the virtual room.
///
internal int y;
internal int lastY;
internal int Y
{
get
{
return y;
}
set
{
lastY = y;
y = value;
}
}
///
/// The height of the user in the virtual room.
///
internal double H;
///
/// The rotation of the user's head in the virtual room.
///
internal byte Z1;
///
/// The rotation of the user's body in the virtual room.
///
internal byte Z2;
///
/// The X position where the user wants to walk to. If not walking, -1.
///
internal int goalX;
///
/// The Y position where the user wants to walk to. If not walking, -1.
///
internal int goalY;
///
/// Specifies if the user can walk.
///
internal bool walkLock;
///
/// Specifies if the user is on his way of leaving the room after clicking the door.
///
internal bool walkDoor;
///
/// The room user ID (rUID) of the virtual user where this virtual user is currently trading items with. If not trading, then this value is -1.
///
internal int _tradePartnerRoomUID = -1;
///
/// Swimming pools only. Specifies the swimming pool outfit.
///
internal string swimOutfit;
///
/// Gamelobbies only. Specifies the amount of gamepoints that this user has for the game in the current gamelobby.
///
internal int gamePoints;
///
/// Is person diving or not?
///
internal bool Diving = false;
internal bool InQueue = false;
///
/// The parent virtual user of this room user.
///
internal virtualUser User;
///
/// The status manager of this room user.
///
internal virtualRoomStatusManager statusManager;
///
/// Indicates if the room user is currently typing a chat message.
///
internal bool isTyping;
///
/// Inidcates if this instance is allowed to talk
///
internal bool allowedToTalk;
///
/// Indicates if the room user is able to use the special teleport cast, which allows him to teleport around the room.
///
internal bool SPECIAL_TELEPORTABLE = false;
///
///
///
private delegate void walkSleepPointer();
///
/// Initializes a virtual room user.
///
/// The database ID of the virtual user of this room user object.
/// The database ID of the room where the room user is in.
/// The ID that identifies the room user in the virtual room.
/// The parent vittual user of this room user.
internal virtualRoomUser(int userID, int roomUID, virtualUser User, virtualRoomStatusManager statusManager, bool allowedToTalk)
{
this.userID = userID;
this.allowedToTalk = allowedToTalk;
this.roomUID = roomUID;
this.User = User;
this.statusManager = statusManager;
}
///
/// Returns the details string for this room user, containing username etc.
///
internal string detailsString
{
get
{
string s = "i:" + roomUID + Convert.ToChar(13) +
"a:" + userID + Convert.ToChar(13) +
"s:" + User._Sex + Convert.ToChar(13) +
"n:" + User._Username + Convert.ToChar(13) +
"f:" + User._Figure + Convert.ToChar(13) +
"l:" + X + " " + Y + " " + H + Convert.ToChar(13);
if (User._Mission != "") { s += "c:" + User._Mission + Convert.ToChar(13); }
else { s += "c:" + " Sunnie is top!" + Convert.ToChar(13); }
string szNotify = "";
for (int x = 0; x < User._Badges.Count; x++)
{
if (User._badgeSlotIDs[x] > 0) // Badge enabled
{
szNotify += User._badgeSlotIDs[x];
szNotify += ":";
szNotify += User._Badges[x];
szNotify += ",";
}
}
if (szNotify != "")
{ s += "b:" + szNotify + Convert.ToChar(13);}
if (swimOutfit != null) { s += "p:" + swimOutfit + Convert.ToChar(13); }
if (User._groupID > 0) { s += "g:" + User._groupID + Convert.ToChar(13) + "t:" + (int)User._groupMemberRank + Convert.ToChar(13); }
return s;
}
}
///
/// Returns the action string for this room user, containing position, movements, statuses etc.
///
internal string statusString
{
get
{
return roomUID + " " + X + "," + Y + "," + H.ToString().Replace(",", ".") + "," + Z1 + "," + Z2 + "/" + statusManager.ToString();
}
}
}
}