本文整理汇总了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>();
}
示例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;
}
}
}
示例3: AddRoom
public Room AddRoom(Enum id)
{
var room = new Room(this, id.ToString());
_rooms.Add(id, room);
return room;
}
示例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;
}
示例5: UserIsWearingBadge
public UserIsWearingBadge(RoomItem item, Room room)
{
Item = item;
Room = room;
Items = new List<RoomItem>();
OtherString = string.Empty;
}
示例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);
}
示例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();
}
示例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());
}
}
示例9: Session
public Session(Slot slot, Room room, Speaker speaker, string title)
{
Slot = slot;
Room = room;
Speaker = speaker;
Title = title;
}
示例10: LessThanTimer
public LessThanTimer(int timeout, Room room, RoomItem item)
{
this.timeout = timeout;
this.room = room;
this.isDisposed = false;
this.item = item;
}
示例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);
}
示例12: WalksOffFurni
public WalksOffFurni(RoomItem Item, Room Room)
{
this.mItem = Item;
this.mRoom = Room;
this.mUsers = new Queue();
this.mItems = new List<RoomItem>();
}
示例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();
}
示例14: SaysKeyword
public SaysKeyword(RoomItem item, Room room)
{
Item = item;
Room = room;
OtherString = string.Empty;
OtherBool = false;
}
示例15: Soccer
public Soccer(Room room)
{
this._room = room;
this.gates = new Item[4];
this._balls = new ConcurrentDictionary<int, Item>();
this._gameStarted = false;
}