当前位置: 首页>>代码示例>>C#>>正文


C# RoomItem类代码示例

本文整理汇总了C#中RoomItem的典型用法代码示例。如果您正苦于以下问题:C# RoomItem类的具体用法?C# RoomItem怎么用?C# RoomItem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


RoomItem类属于命名空间,在下文中一共展示了RoomItem类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: WalksOnFurni

 public WalksOnFurni(RoomItem item, Room room)
 {
     Item = item;
     Room = room;
     ToWork = new Queue();
     Items = new List<RoomItem>();
 }
开发者ID:BjkGkh,项目名称:Azure2,代码行数:7,代码来源:WalksOnFurni.cs

示例2: OnTrigger

        public void OnTrigger(GameClients.GameClient Session, RoomItem Item, int Request, bool HasRights)
        {
            if (!HasRights)
            {
                return;
            }

            int OldValue = 0;

            if (!int.TryParse(Item.ExtraData, out OldValue))
            {

            }

            if (Request == 1)
            {
                OldValue++;
            }
            else if (Request == 2)
            {
                OldValue--;
            }
            else if (Request == 3)
            {
                OldValue = 0;
            }

            Item.ExtraData = OldValue.ToString();
            Item.UpdateState(false, true);
        }
开发者ID:BjkGkh,项目名称:Custom-R2,代码行数:30,代码来源:InteractorScoreCounter.cs

示例3: OnPlace

 public void OnPlace(GameClient Session, RoomItem Item)
 {
     if (Item.team == Team.none)
         return;
     Item.ExtraData = Item.GetRoom().GetGameManager().Points[(int)Item.team].ToString();
     Item.UpdateState(false, true);
 }
开发者ID:kessiler,项目名称:habboServer,代码行数:7,代码来源:InteractorFreezeScoreCounter.cs

示例4: UserIsNotWearingBadge

 public UserIsNotWearingBadge(RoomItem item, Room room)
 {
     Item = item;
     Room = room;
     Items = new List<RoomItem>();
     OtherString = string.Empty;
 }
开发者ID:kessiler,项目名称:azureEmulator,代码行数:7,代码来源:UserIsNotWearingBadge.cs

示例5: OnTrigger

        public void OnTrigger(GameClient session, RoomItem item, int request, bool hasRights)
        {
            if (!hasRights)
                return;
            if (item == null || item.GetBaseItem() == null || item.GetBaseItem().InteractionType != Interaction.Gate)
                return;

            var modes = item.GetBaseItem().Modes - 1;
            if (modes <= 0)
                item.UpdateState(false, true);

            if (item.GetRoom() == null || item.GetRoom().GetGameMap() == null || item.GetRoom().GetGameMap().SquareHasUsers(item.X, item.Y))
                return;

            int currentMode;
            int.TryParse(item.ExtraData, out currentMode);
            int newMode;
            if (currentMode <= 0)
                newMode = 1;
            else if (currentMode >= modes)
                newMode = 0;
            else
                newMode = currentMode + 1;

            if (newMode == 0 && !item.GetRoom().GetGameMap().ItemCanBePlacedHere(item.X, item.Y))
                return;

            item.ExtraData = newMode.ToString();
            item.UpdateState();
            item.GetRoom().GetGameMap().UpdateMapForItem(item);
            item.GetRoom().GetWiredHandler().ExecuteWired(Interaction.TriggerStateChanged, item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(session.GetHabbo().Id), item);
        }
开发者ID:BjkGkh,项目名称:Azure2,代码行数:32,代码来源:InteractorGate.cs

示例6: SaysKeyword

 public SaysKeyword(RoomItem item, Room room)
 {
     Item = item;
     Room = room;
     OtherString = string.Empty;
     OtherBool = false;
 }
开发者ID:sgf,项目名称:Yupi,代码行数:7,代码来源:SaysKeyword.cs

示例7: AddFreezeBlock

        internal void AddFreezeBlock(RoomItem item)
        {
            if (freezeBlocks.ContainsKey(item.Id))
                freezeBlocks.Remove(item.Id);

            freezeBlocks.Add(item.Id, item);
        }
开发者ID:habb0,项目名称:Bfly,代码行数:7,代码来源:Freeze.cs

示例8: OnTrigger

        public void OnTrigger(GameClients.GameClient Session, RoomItem Item, int Request, bool HasRights)
        {
            RoomUser User = null;
            if (Session != null)
                User = Item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);
            if (User == null)
                return;

            if (Gamemap.TilesTouching(Item.GetX, Item.GetY, User.X, User.Y))
            {
                if (Item.ExtraData != "-1")
                {
                    if (Request == -1)
                    {
                        Item.ExtraData = "0";
                        Item.UpdateState();
                    }
                    else
                    {
                        Item.ExtraData = "-1";
                        Item.UpdateState(false, true);
                        Item.ReqUpdate(4, true);
                    }
                }
            }
            else
            {
                User.MoveTo(Item.SquareInFront);
            }
        }
开发者ID:BjkGkh,项目名称:Custom-R2,代码行数:30,代码来源:InteractorDice.cs

示例9: MoveToDir

 public MoveToDir(RoomItem item, Room room)
 {
     Item = item;
     Room = room;
     Items = new List<RoomItem>();
     Delay = 0;
 }
开发者ID:kessiler,项目名称:azureEmulator,代码行数:7,代码来源:MoveToDir.cs

示例10: OnTrigger

        public override void OnTrigger(GameClient session, RoomItem item, int request, bool hasRights)
        {
            if (!hasRights)
                return;

            int num;
            int.TryParse(item.ExtraData, out num);

            switch (request)
            {
                case 1:
                    if (item.PendingReset && num > 0)
                    {
                        num = 0;
                        item.PendingReset = false;
                    }
                    else
                    {
                        num += 60;
                        item.UpdateNeeded = false;
                    }
                    break;

                case 2:
                    item.UpdateNeeded = !item.UpdateNeeded;
                    item.PendingReset = true;
                    break;
            }

            item.ExtraData = num.ToString();
            item.UpdateState();
        }
开发者ID:kessiler,项目名称:azureEmulator,代码行数:32,代码来源:InteractorScoreboard.cs

示例11: OnPlace

		public void OnPlace(GameClient Session, RoomItem Item)
		{
			Item.ExtraData = "0";
			if (Item.InteractingUser != 0u)
			{
				RoomUser roomUserByHabbo = Item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(Item.InteractingUser);
				if (roomUserByHabbo != null)
				{
					roomUserByHabbo.ClearMovement(true);
					roomUserByHabbo.AllowOverride = false;
					roomUserByHabbo.CanWalk = true;
				}
				Item.InteractingUser = 0u;
			}
			if (Item.InteractingUser2 != 0u)
			{
				RoomUser roomUserByHabbo2 = Item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(Item.InteractingUser2);
				if (roomUserByHabbo2 != null)
				{
					roomUserByHabbo2.ClearMovement(true);
					roomUserByHabbo2.AllowOverride = false;
					roomUserByHabbo2.CanWalk = true;
				}
				Item.InteractingUser2 = 0u;
			}
		}
开发者ID:BjkGkh,项目名称:Mercury,代码行数:26,代码来源:InteractorTeleport.cs

示例12: OnTrigger

        public override void OnTrigger(GameClient session, RoomItem item, int request, bool hasRights)
        {
            if (session == null)
                return;

            RoomUser user = item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(session.GetHabbo().Id);

            if (user == null)
                return;

            if (user.Coordinate != item.SquareInFront && user.CanWalk)
            {
                user.MoveTo(item.SquareInFront);
                return;
            }

            if (!item.GetRoom().GetGameMap().CanWalk(item.SquareBehind.X, item.SquareBehind.Y, user.AllowOverride))
                return;

            if (item.InteractingUser == 0)
            {
                item.InteractingUser = user.HabboId;

                user.CanWalk = false;

                if (user.IsWalking && (user.GoalX != item.SquareInFront.X || user.GoalY != item.SquareInFront.Y))
                    user.ClearMovement();

                user.AllowOverride = true;
                user.MoveTo(item.Coordinate);

                item.ReqUpdate(4, true);
            }
        }
开发者ID:sgf,项目名称:Yupi,代码行数:34,代码来源:InteractorOneWayGate.cs

示例13: GetServerMessage

 internal ServerMessage GetServerMessage(ServerMessage message, RoomItem item)
 {
     var cracks = 0;
     var cracks_max = MaxCracks(item.GetBaseItem().Name);
     if (AzureEmulator.IsNum(item.ExtraData))
         cracks = Convert.ToInt16(item.ExtraData);
     var state = "0";
     if (cracks >= cracks_max)
         state = "14";
     else if (cracks >= cracks_max * 6 / 7)
         state = "12";
     else if (cracks >= cracks_max * 5 / 7)
         state = "10";
     else if (cracks >= cracks_max * 4 / 7)
         state = "8";
     else if (cracks >= cracks_max * 3 / 7)
         state = "6";
     else if (cracks >= cracks_max * 2 / 7)
         state = "4";
     else if (cracks >= cracks_max * 1 / 7)
         state = "2";
     message.AppendInteger(7);
     message.AppendString(state); //state (0-7)
     message.AppendInteger(cracks); //actual
     message.AppendInteger(cracks_max); //max
     return message;
 }
开发者ID:BjkGkh,项目名称:Azure2,代码行数:27,代码来源:CrackableEggHandler.cs

示例14: OnTrigger

        public override void OnTrigger(GameClient session, RoomItem item, int request, bool hasRights)
        {
            RoomUser roomUser = null;

            if (session != null)
                roomUser = item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(session.GetHabbo().Id);

            if (roomUser == null)
                return;

            if (Gamemap.TilesTouching(item.X, item.Y, roomUser.X, roomUser.Y))
            {
                var num = item.GetBaseItem().Modes - 1;
                int num2, num3;
                int.TryParse(item.ExtraData, out num2);

                if (num2 <= 0)
                    num3 = 1;
                else
                {
                    if (num2 >= num)
                        num3 = 0;
                    else
                        num3 = num2 + 1;
                }

                item.ExtraData = num3.ToString();
                item.UpdateState();
                item.GetRoom().GetWiredHandler().ExecuteWired(Interaction.TriggerStateChanged, roomUser, item);

                return;
            }

            roomUser.MoveTo(item.SquareInFront);
        }
开发者ID:kessiler,项目名称:azureEmulator,代码行数:35,代码来源:InteractorSwitch.cs

示例15: AddPuck

        internal void AddPuck(RoomItem item)
        {
            if (_pucks.ContainsKey(item.Id))
                return;

            _pucks.Add(item.Id, item);
        }
开发者ID:weslley17w,项目名称:Yupi,代码行数:7,代码来源:BattleBanzai.cs


注:本文中的RoomItem类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。