本文整理汇总了C#中RoomUser类的典型用法代码示例。如果您正苦于以下问题:C# RoomUser类的具体用法?C# RoomUser怎么用?C# RoomUser使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RoomUser类属于命名空间,在下文中一共展示了RoomUser类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnUserWalk
internal void OnUserWalk(RoomUser User)
{
if (User == null)
return;
foreach (RoomItem item in pucks.Values)
{
int differenceX = User.X - item.GetX;
int differenceY = User.Y - item.GetY;
if (differenceX <= 1 && differenceX >= -1 && differenceY <= 1 && differenceY >= -1)
{
int NewX = differenceX * -1;
int NewY = differenceY * -1;
NewX = NewX + item.GetX;
NewY = NewY + item.GetY;
if (item.interactingBallUser == User.userID && room.GetGameMap().ValidTile(NewX, NewY))
{
item.interactingBallUser = 0;
MovePuck(item, User.GetClient(), User.Coordinate, item.Coordinate, 6, User.team);
}
else if (room.GetGameMap().ValidTile(NewX, NewY))
{
MovePuck(item, User.GetClient(), NewX, NewY, User.team);
}
}
}
if (banzaiStarted)
{
HandleBanzaiTiles(User.Coordinate, User.team, User);
}
}
示例2: DeliverRandomPinataItem
/// <summary>
/// Delivers the random pinata item.
/// </summary>
/// <param name="user">The user.</param>
/// <param name="room">The room.</param>
/// <param name="item">The item.</param>
internal void DeliverRandomPinataItem(RoomUser user, Room room, RoomItem item)
{
if (room == null || item == null || item.GetBaseItem().InteractionType != Interaction.Pinata ||
!Pinatas.ContainsKey(item.GetBaseItem().ItemId))
return;
PinataItem pinataItem;
Pinatas.TryGetValue(item.GetBaseItem().ItemId, out pinataItem);
if (pinataItem == null || pinataItem.Rewards.Count < 1)
return;
item.RefreshItem();
//@TODO :: KESSILER, now PINATA DOESNT WORK. MUST CREATE SOLUTION LATER.
//item.BaseName = pinataItem.Rewards[new Random().Next((pinataItem.Rewards.Count - 1))];
item.ExtraData = string.Empty;
room.GetRoomItemHandler().RemoveFurniture(user.GetClient(), item.Id, false);
using (IQueryAdapter queryReactor = Yupi.GetDatabaseManager().GetQueryReactor())
queryReactor.RunFastQuery(
$"UPDATE items_rooms SET item_name='{item.BaseName}', extra_data='' WHERE id='{item.Id}'");
if (!room.GetRoomItemHandler().SetFloorItem(user.GetClient(), item, item.X, item.Y, 0, true, false, true))
user.GetClient().GetHabbo().GetInventoryComponent().AddItem(item);
}
示例3: WiredConditionsMet
public bool WiredConditionsMet(RoomUser user, Room theRoom)
{
if (handler.conditionHandler != null)
return handler.conditionHandler.AllowsHandling(item.GetX, item.GetY, user, theRoom);
return true;
}
示例4: RoomBot
internal RoomBot(uint BotId, uint OwnerId, UInt32 RoomId, AIType AiType, string WalkingMode, string Name, string Motto, string Look,
int X, int Y, double Z, int Rot, int minX, int minY, int maxX, int maxY, ref List<RandomSpeech> Speeches,
ref List<BotResponse> Responses, string Gender, int Dance)
{
this.OwnerId = OwnerId;
this.BotId = BotId;
this.RoomId = RoomId;
this.AiType = AiType;
this.WalkingMode = WalkingMode;
this.Name = Name;
this.Motto = Motto;
this.Look = Look;
this.X = X;
this.Y = Y;
this.Z = Z;
this.Rot = Rot;
this.minX = minX;
this.minY = minY;
this.maxX = maxX;
this.maxY = maxY;
this.Gender = Gender.ToUpper();
this.VirtualId = -1;
this.RoomUser = null;
this.DanceId = Dance;
this.RandomSpeech = Speeches;
this.Responses = Responses;
}
示例5: OnUserWalk
public void OnUserWalk(GameClient session, RoomItem item, RoomUser user)
{
if (session == null || item == null || user == null) return;
var distance = PathFinder.GetDistance(user.X, user.Y, item.X, item.Y);
if (distance > 0 || user.GoalX == 0 && user.GoalY == 0) return;
// Logic moved to Gamemap.cs
/*item.ExtraData = "0";
item.UpdateState(false, true);
item.InteractingUser = user.UserId;
if (user.GoalX != item.X || user.GoalY != item.Y) return;
switch (user.RotBody)
{
case 3:
case 4:
case 5:
user.MoveTo(item.GetRoom()
.GetGameMap()
.CanWalk(item.SquareBehind.X, item.SquareBehind.Y, user.AllowOverride)
? item.SquareBehind
: item.SquareInFront);
break;
default:
user.MoveTo(item.GetRoom()
.GetGameMap()
.CanWalk(item.SquareInFront.X, item.SquareInFront.Y, user.AllowOverride)
? item.SquareInFront
: item.SquareBehind);
break;
}*/
}
示例6: OnUserWalk
internal void OnUserWalk(RoomUser User)
{
if (User == null)
return;
foreach (RoomItem item in balls.Values)
{
int differenceX = User.X - item.GetX;
int differenceY = User.Y - item.GetY;
if (differenceX <= 1 && differenceX >= -1 && differenceY <= 1 && differenceY >= -1)
{
int NewX = differenceX * -1;
int NewY = differenceY * -1;
NewX = NewX + item.GetX;
NewY = NewY + item.GetY;
if (item.interactingBallUser == User.userID && item.GetRoom().GetGameMap().ValidTile(NewX, NewY))
{
item.interactingBallUser = 0;
MoveBall(item, User.GetClient(), User.Coordinate, item.Coordinate, 6);
}
else if (item.GetRoom().GetGameMap().ValidTile(NewX, NewY))
{
MoveBall(item, User.GetClient(), NewX, NewY);
}
}
}
}
示例7: OnUserWalk
internal void OnUserWalk(RoomUser User)
{
if (User == null)
return;
foreach (RoomItem roomItem in this.pucks.Values)
{
int num1 = checked(User.X - roomItem.GetX);
int num2 = checked(User.Y - roomItem.GetY);
if (num1 <= 1 && num1 >= -1 && num2 <= 1 && num2 >= -1)
{
int num3 = checked(num1 * -1);
int num4 = checked(num2 * -1);
int num5 = checked(num3 + roomItem.GetX);
int num6 = checked(num4 + roomItem.GetY);
if ((int)roomItem.interactingBallUser == (int)User.UserID && this.room.GetGameMap().ValidTile(num5, num6))
{
roomItem.interactingBallUser = 0U;
this.MovePuck(roomItem, User.GetClient(), User.Coordinate, roomItem.Coordinate, 6, User.team);
}
else if (this.room.GetGameMap().ValidTile(num5, num6))
this.MovePuck(roomItem, User.GetClient(), num5, num6, User.team);
}
}
if (!this.banzaiStarted)
return;
this.HandleBanzaiTiles(User.Coordinate, User.team, User);
}
示例8: AllowsExecution
public bool AllowsExecution(RoomUser user, Room theRoom)
{
GenericTriggerWithModes.DoAnimation(this.item);
int coord = 0;
Gamemap map = theRoom.GetGameMap();
Dictionary<int, ThreeDCoord> points;
bool userInLoop;
foreach (RoomItem item in items)
{
userInLoop = false;
points = Gamemap.GetAffectedTiles(item.GetBaseItem().Length, item.GetBaseItem().Width, item.GetX, item.GetY, item.Rot);
foreach (ThreeDCoord coor in points.Values)
{
coord = TextHandling.CombineXYCoord(coor.X, coor.Y);
if (map.GetRoomUsers(coord).Count != 0)
{
userInLoop = true;
break;
}
}
if (!userInLoop)
return false;
}
return true;
}
示例9: DeliverRandomPinataItem
/// <summary>
/// Delivers the random pinata item.
/// </summary>
/// <param name="user">The user.</param>
/// <param name="room">The room.</param>
/// <param name="item">The item.</param>
internal void DeliverRandomPinataItem(RoomUser user, Room room, RoomItem item)
{
if (room == null || item == null || item.GetBaseItem().InteractionType != Interaction.Pinata || !Pinatas.ContainsKey(item.GetBaseItem().ItemId))
return;
PinataItem pinataItem;
Pinatas.TryGetValue(item.GetBaseItem().ItemId, out pinataItem);
if (pinataItem == null || pinataItem.Rewards.Count < 1)
return;
item.RefreshItem();
item.BaseItem = pinataItem.Rewards[new Random().Next((pinataItem.Rewards.Count - 1))];
item.ExtraData = string.Empty;
room.GetRoomItemHandler().RemoveFurniture(user.GetClient(), item.Id, false);
using (var queryReactor = AzureEmulator.GetDatabaseManager().GetQueryReactor())
{
queryReactor.RunFastQuery(string.Format("UPDATE items_rooms SET base_item='{0}', extra_data='' WHERE id='{1}'", item.BaseItem, item.Id));
queryReactor.RunQuery();
}
if (!room.GetRoomItemHandler().SetFloorItem(user.GetClient(), item, item.X, item.Y, 0, true, false, true))
user.GetClient().GetHabbo().GetInventoryComponent().AddItem(item);
}
示例10: AddPointToTeam
internal void AddPointToTeam(Team team, int points, RoomUser user)
{
int num = checked(this.TeamPoints[(int)team] += points);
if (num < 0)
{
num = 0;
}
this.TeamPoints[(int)team] = num;
if (this.OnScoreChanged != null)
{
this.OnScoreChanged(null, new TeamScoreChangedArgs(num, team, user));
}
foreach (RoomItem current in this.GetFurniItems(team).Values)
{
if (!GameManager.isSoccerGoal(current.GetBaseItem().InteractionType))
{
current.ExtraData = this.TeamPoints[(int)team].ToString();
current.UpdateState();
}
}
room.GetWiredHandler().ExecuteWired(WiredItemType.TriggerScoreAchieved, new object[]
{
user
});
}
示例11: OnUserWalk
internal void OnUserWalk(RoomUser user)
{
if (user == null) return;
foreach (RoomItem roomItem in _pucks.Values)
{
int differenceX = user.X - roomItem.X;
int differenceY = user.Y - roomItem.Y;
if (differenceX > 1 || differenceX < -1 || differenceY > 1 || differenceY < -1)
continue;
int newX = differenceX*-1 + roomItem.X;
int newY = differenceY*-1 + roomItem.Y;
if (roomItem.InteractingBallUser == user.UserId && _room.GetGameMap().ValidTile(newX, newY))
{
roomItem.InteractingBallUser = 0;
MovePuck(roomItem, user.GetClient(), user.Coordinate, roomItem.Coordinate, 6, user.Team);
}
else if (_room.GetGameMap().ValidTile(newX, newY))
MovePuck(roomItem, user.GetClient(), newX, newY, user.Team);
}
if (IsBanzaiActive)
HandleBanzaiTiles(user.Coordinate, user.Team, user);
}
示例12: ActivateShield
private static void ActivateShield(RoomUser user)
{
int Effect = (int)user.team + 48;
user.GetClient().GetHabbo().GetEffectsInventoryComponent().method_2(Effect, true);
user.shieldActive = true;
user.shieldCounter += 10;
}
示例13: OnUserChat
internal override void OnUserChat(RoomUser user, string text, bool shout)
{
if (!_unit.GetRoom().CheckRights(user.GetClient(), true))
return;
if (text == "yes")
{
}
}
示例14: AllowsExecution
public bool AllowsExecution(RoomUser user)
{
if (room.lastTimerReset == null)
return false;
TimeSpan sinceTimerReset = DateTime.Now - room.lastTimerReset;
return (sinceTimerReset.TotalSeconds > timeout);
}
示例15: Init
internal void Init(uint pBaseId, int pRoomUserId, uint pRoomId, RoomUser user, Room room)
{
this.BaseId = pBaseId;
this.RoomUserId = pRoomUserId;
this.RoomId = pRoomId;
this.roomUser = user;
this.room = room;
}