• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Room类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



Room类属于命名空间,在下文中一共展示了Room类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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: Update

 public override void Update(Room room, Player player)
 {
     Vector2 offset = player.position - position;
     Vector2 range = Main.instance.Size();
     if (Math.Abs(offset.X) > range.X / 2f || Math.Abs(offset.Y) > range.Y / 2f)
     {
         shootTimer = 0;
     }
     else
     {
         shootTimer++;
         if (shootTimer >= maxShootTimer)
         {
             Vector2 direction = offset;
             if (direction != Vector2.Zero)
             {
                 direction.Normalize();
             }
             direction *= shootSpeed;
             PositionalBullet bullet = new PositionalBullet(position, direction, 10f, bulletTexture, bulletTime);
             room.bullets.Add(bullet);
             shootTimer = 0;
         }
     }
 }
开发者ID:bluemagic123,项目名称:Slip,代码行数:25,代码来源:Turret.cs


示例3: AddRoom

        public Room AddRoom(Enum id)
        {
            var room = new Room(this, id.ToString());
            _rooms.Add(id, room);

            return room;
        }
开发者ID:rishabhbanga,项目名称:CK.HomeAutomation,代码行数:7,代码来源:Home.cs


示例4: BuildLevel

    public static void BuildLevel()
    {
        Room room00 = new Room("room 00", "It's clearly a room");

        Room room01 = new Room("room 01", "It's clearly a room");
        Room room02 = new Room("room 02", "It's clearly a room");
        Room room10 = new Room("room 10", "It's clearly a room");
        Room room11 = new Room("room 11", "It's clearly a room");
        Room room12 = new Room("room 12", "It's clearly a room");
        //Room room20 = new Room("room 20", "room description");
        //Room room21 = new Room("room 21", "room description");
        Room room22 = new Room("room 22", "It's clearly a room");

        Item key = new Item("Key", "A brass object used to unlock a specific lock. Commonly known as a 'Key'", room11, null, Action.OpenDoor, room11);
        room11.AddItem(key);

        Door door = new Door("Door", "A wooden board with hinges on one side, usually used to block a passage way. Commonly known as a 'Door'", room12, room22, key, null, Action.None);
        door.locked = true;
        room12.doorSouth = door;
        room12.AddObject(door);
        room22.doorNorth = door;
        room22.AddObject(door);

        dungeon[0, 0] = room00;
        dungeon[0, 1] = room01;
        dungeon[0, 2] = room02;
        dungeon[1, 0] = room10;
        dungeon[1, 1] = room11;
        dungeon[1, 2] = room12;
        //dungeon[2, 0] = room20;
        //dungeon[2, 1] = room21;
        dungeon[2, 2] = room22;

        startingRoom = room00;
    }
开发者ID:MedeirosMarcelo,项目名称:MUD,代码行数:35,代码来源:GameManager.cs


示例5: UserIsWearingBadge

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


示例6: RoomImage

        public RoomImage(Room room, Wall wall, Point source)
        {
            if(!room.Walls.Contains(wall) || !room.Sources.Contains(source)) throw new ArgumentException("Room elements are non-existent");
            ImageWalls = new Wall[room.Walls.Count];
            ImageWalls[0] = wall;

            int i = 1;
            foreach (Wall roomWall in room.Walls)
            {
                if (roomWall == wall) continue;
                Point startVector = Geometry.ParallelProjection(wall, roomWall.Start,true);
                startVector.X -= roomWall.Start.X;
                startVector.Y -= roomWall.Start.Y;

                Point endVector = Geometry.ParallelProjection(wall, roomWall.End, true);
                endVector.X -= roomWall.End.X;
                endVector.Y -= roomWall.End.Y;

                Point newStart = new Point(roomWall.Start.X+2*startVector.X,roomWall.Start.Y+2*startVector.Y);
                Point newEnd = new Point(roomWall.End.X + 2 * endVector.X, roomWall.End.Y + 2 * endVector.Y);
                ImageWalls[i] = new Wall(newStart,newEnd,roomWall.WallMaterial);
                i++;
            }
            Point sourceVector = Geometry.ParallelProjection(wall, source, true);
            sourceVector.X -= source.X;
            sourceVector.Y -= source.Y;
            Source = new Point(source.X+2*sourceVector.X,source.Y+2*sourceVector.Y);
        }
开发者ID:Earlvik,项目名称:ArtiStereo,代码行数:28,代码来源:RoomImage.cs


示例7: Stu

        public Stu(Point position, Room.Room room)
            : base(room)
        {
            Stats = new CharacterStats
            {
                MinimumDamage = 10,
                MaximumDamage = 15,
                BaseHealth = 100,
                DamageReduction = 0.04,
                Dexterity = 15
            };

            Position = position;

            /*Drinks.Add(new OrangeJuice());
            Drinks.Add(new RedBull());
            Drinks.Add(new Coffee());
            FoodItems.Add(new Pizza());
            FoodItems.Add(new Burger());
            FoodItems.Add(new Taco());*/

            ResourceImage = "Resources/stu.jpg";
            Name = "Stu";

            ResetHealth();
        }
开发者ID:Gupocca,项目名称:design-patterns,代码行数:26,代码来源:Stu.cs


示例8: OnJoinRoom

    public void OnJoinRoom(BaseEvent evt)
    {
        Room room = (Room)evt.Params["room"];
        currentActiveRoom = room;

        Debug.Log("onjoinroom = " + currentActiveRoom.Name);

        if (room.Name == "The Lobby")
            Application.LoadLevel(room.Name);
        else if (room.IsGame)
        {
            //Debug.Log("is game!!!!");
            //store my own color on server as user data
            List<UserVariable> uData = new List<UserVariable>();
            uData.Add(new SFSUserVariable("playerID", GameValues.playerID));
            smartFox.Send(new SetUserVariablesRequest(uData));
            Application.LoadLevel("testScene");
        }
        else
        {
            Debug.Log("GameLobby- OnJoinRoom: joined " + room.Name);
            Application.LoadLevel("Game Lobby");
            Debug.Log("loading Game Lobby");
            //smartFox.Send(new SpectatorToPlayerRequest());
        }
    }
开发者ID:ice0001,项目名称:Cubes-in-Space,代码行数:26,代码来源:GameLobby.cs


示例9: Session

 public Session(Slot slot, Room room, Speaker speaker, string title)
 {
     Slot = slot;
     Room = room;
     Speaker = speaker;
     Title = title;
 }
开发者ID:AntoineGa,项目名称:microstuff,代码行数:7,代码来源:Session.cs


示例10: LessThanTimer

 public LessThanTimer(int timeout, Room room, RoomItem item)
 {
     this.timeout = timeout;
     this.room = room;
     this.isDisposed = false;
     this.item = item;
 }
开发者ID:BjkGkh,项目名称:Custom-R2,代码行数:7,代码来源:LessThanTimer.cs


示例11: Distribute

        private static void Distribute(IDictionary<int, Person> people, Room room, int maxIterations)
        {
            var index = 0;
            var peopleByNumberFriends = people.Values.OrderBy(x => x.NumberOfFriends).ToArray();
            var spotsByNumberNeighbours = room.OrderBy(x => x.Neighbours.Keys.Count).ToArray();

            foreach (var spot in spotsByNumberNeighbours) {
                spot.Person = peopleByNumberFriends[index++];
            }

            var iterations = 0;
            var changeMade = false;
            do {
                var awfulSpots = room.OrderBy(x => x.Score).ToList();
                var spot1 = awfulSpots.First();
                foreach (var spot2 in awfulSpots.Skip(1)) {
                    var currentScore = spot1.Score + spot2.Score;
                    var p1 = spot1.Person;
                    var p2 = spot2.Person;
                    spot1.Person = p2;
                    spot2.Person = p1;

                    if (spot1.Score + spot2.Score > currentScore) {
                        changeMade = true;
                        break;
                    }

                    // restore
                    spot1.Person = p1;
                    spot2.Person = p2;
                }
                iterations++;
            } while (changeMade && iterations < maxIterations);
        }
开发者ID:mstaessen,项目名称:Primers,代码行数:34,代码来源:Program.cs


示例12: WalksOffFurni

 public WalksOffFurni(RoomItem Item, Room Room)
 {
     this.mItem = Item;
     this.mRoom = Room;
     this.mUsers = new Queue();
     this.mItems = new List<RoomItem>();
 }
开发者ID:BjkGkh,项目名称:07052014,代码行数:7,代码来源:WalksOffFurni.cs


示例13: ConditionHandler

        private Hashtable roomMatrix; //Coord | List<IWiredCondition>

        #endregion Fields

        #region Constructors

        public ConditionHandler(Room room)
        {
            this.room = room;
            this.roomMatrix = new Hashtable();
            this.addQueue = new Queue();
            this.removeQueue = new Queue();
        }
开发者ID:TheNaked,项目名称:Firewind,代码行数:13,代码来源:ConditionHandler.cs


示例14: SaysKeyword

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


示例15: Soccer

 public Soccer(Room room)
 {
     this._room = room;
     this.gates = new Item[4];
     this._balls = new ConcurrentDictionary<int, Item>();
     this._gameStarted = false;
 }
开发者ID:BjkGkh,项目名称:Boon,代码行数:7,代码来源:Soccer.cs


示例16: JoinTeam

 //private List<InteractionType> mBanned;
 public JoinTeam(RoomItem item, Room room)
 {
     Item = item;
     Room = room;
     _mDelay = 0;
     //this.mBanned = new List<InteractionType>();
 }
开发者ID:BjkGkh,项目名称:Azure2,代码行数:8,代码来源:JoinTeam.cs


示例17: LinkRoom

    private void LinkRoom(Room StartRoom, Room DestinationRoom, string Direction)
    {
        if (StartRoom == null) return;

        switch (Direction.ToLower())
        {
            case "west":
                StartRoom.West = DestinationRoom;
                if (DestinationRoom.East == null) { DestinationRoom.East = StartRoom; }
                break;
            case "east":
                StartRoom.East = DestinationRoom;
                if (DestinationRoom.West == null) { DestinationRoom.West = StartRoom; }
                break;
            case "north":
                StartRoom.North = DestinationRoom;
                if (DestinationRoom.South == null) { DestinationRoom.South = StartRoom; }
                break;
            case "south":
                StartRoom.West = DestinationRoom;
                if (DestinationRoom.North == null) { DestinationRoom.North = StartRoom; }
                break;
            default:
                if (StartRoom.AdditionalLink[Direction] == null)
                {
                    StartRoom.AdditionalLink[Direction] = DestinationRoom;
                }
                break;
        }
    }
开发者ID:Midimistro,项目名称:Deadmen,代码行数:30,代码来源:FloorLogicManager.cs


示例18: HasAllRequiredFurnis

        internal bool HasAllRequiredFurnis(Room room)
        {
            if (room == null)
                return false;

            return RequiredFurnis.All(furni => room.GetRoomItemHandler().HasFurniByItemName(furni));
        }
开发者ID:ImNotSatan,项目名称:Yupi,代码行数:7,代码来源:RoomCompetitionManager.cs


示例19: GenerateRooms

        public override Room[,] GenerateRooms(int maxRooms)
        {
            Directions[] directions = (Directions[])Enum.GetValues(typeof(Directions));
            List<Room> rooms = new List<Room>();
            rooms.Add(new Room(new Point(0, 0)));

            while (rooms.Count < maxRooms)
            {
                Room targetRoom = rooms[Randomizer.GetRandomNumber(rooms.Count)];
                Directions direction = Randomizer.GetRandomDirection();
                Exit targetExit = targetRoom.GetExit(direction);

                if (targetExit != null)
                    continue;

                targetExit = new Exit(direction);
                targetRoom.AddExit(direction);
                Room neighbor = GetRoomAtPoint(targetRoom.GetNeighborCoordinates(direction), rooms);
                Directions neighborDirection = ReverseDirection(direction);

                if (neighbor != null)
                    neighbor.AddExit(neighborDirection);
                else
                {
                    Room newRoom = new Room(targetRoom.GetNeighborCoordinates(direction));
                    newRoom.AddExit(neighborDirection);
                    rooms.Add(newRoom);
                }
            }
            Room[,] roomArray = ConvertListToMap(MarkSpecialRooms<Room>(rooms));

            return roomArray;
        }
开发者ID:GabrielWilds,项目名称:Momolike,代码行数:33,代码来源:RandomMapGenerator.cs


示例20: addRoom

        public bool addRoom(Room room)
        {
            try
            {
                int param = 3;

                string[] name = new string[param];
                object[] value = new object[param];

                name[0] = "@name"; value[0] = room.Name;
                name[1] = "@statusid"; value[1] = room.StatusID;
                name[2] = "@roomtypeid"; value[2] = room.RoomType;

                int result = this.Update("Room_Insert", name, value, param);
                if (result != 0)
                {
                    return true;
                }
            }
            catch (System.Exception ex)
            {
                Console.WriteLine("Message = {1}", ex.Message);
            }

            return false;
        }
开发者ID:nguyenvanuyn96,项目名称:MotelManagermentFinal,代码行数:26,代码来源:RoomDAT.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# RoomData类代码示例发布时间:2022-05-24
下一篇:
C# Roles类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap