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


C# Room类代码示例

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


Room类属于命名空间,在下文中一共展示了Room类的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: 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


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