Ejemplo n.º 1
0
 public void RemoveMod(RoomModifier mod, bool all = true)
 {
     if (mod is BaseRoomMod)
     {
         BaseMods.Remove((BaseRoomMod)mod, all);
     }
     else if (mod is DefiningRoomMod)
     {
         DefiningMods.Remove((DefiningRoomMod)mod, all);
     }
     else if (mod is HeavyRoomMod)
     {
         HeavyMods.Remove((HeavyRoomMod)mod, all);
     }
     else if (mod is FillRoomMod)
     {
         FillMods.Remove((FillRoomMod)mod, all);
     }
     else if (mod is FinalRoomMod)
     {
         FinalMods.Remove((FinalRoomMod)mod, all);
     }
     else
     {
         throw new ArgumentException("Cannot inherit directly from RoomModifier");
     }
 }
Ejemplo n.º 2
0
 public void AddMod(RoomModifier mod, double multiplier, bool unique = false)
 {
     if (mod is BaseRoomMod)
     {
         BaseMods.Add((BaseRoomMod)mod, multiplier, unique || mod.Unique);
     }
     else if (mod is DefiningRoomMod)
     {
         DefiningMods.Add((DefiningRoomMod)mod, multiplier, unique || mod.Unique);
     }
     else if (mod is HeavyRoomMod)
     {
         HeavyMods.Add((HeavyRoomMod)mod, multiplier, unique || mod.Unique);
     }
     else if (mod is FillRoomMod)
     {
         FillMods.Add((FillRoomMod)mod, multiplier, unique || mod.Unique);
     }
     else if (mod is FinalRoomMod)
     {
         FinalMods.Add((FinalRoomMod)mod, multiplier, unique || mod.Unique);
     }
     else
     {
         throw new ArgumentException("Cannot inherit directly from RoomModifier");
     }
 }
Ejemplo n.º 3
0
        protected Room CreateRoom(Tile tile, RoomModifier modifier, TileType type)
        {
            var tileScale = tile.transform.localScale;

            var room = new GameObject("Complete room").AddComponent <Room>();

            room.transform.SetParent(roomContainer);

            room.Id       = tile.Id;
            room.TileType = tile.Type;
            room.Modifier = modifier;

            var floor = CreateFloor(tile, room, tileScale);

            switch (type)
            {
            case TileType.Regular:
                break;

            case TileType.StaircaseDown:
            case TileType.StaircaseUp:
                CreateStairRoom(tile, room, tileScale, floor);

                break;

            case TileType.Main:
                CreateMainRoom(tile, room, tileScale, floor);
                break;
            }

            room.Center = tile.BottomRectangle.Center + new float3(0, .5f, 0);

            return(room);
        }
Ejemplo n.º 4
0
    public override bool Equals(object obj)
    {
        RoomModifier rhs = obj as RoomModifier;

        if (rhs == null)
        {
            return(false);
        }
        return(GetType().Equals(rhs.GetType()));
    }