public static List <Room> ListOfRooms() { var areas = new List <Room> { Ambush.TutorialRoom1(), Ambush.TutorialRoom2(), Ambush.TutorialLostInTheWoods(), Ambush.TutorialLostInTheWoods2(), Ambush.TutorialLostInTheWoods3(), Ambush.TutorialLostInTheWoods4(), Ambush.TutorialLostInTheWoods5(), Ambush.TutorialLostInTheWoods6(), Ambush.TutorialGoblinCamp(), Ambush.TutorialGoblinCampTentNorth(), Ambush.TutorialGoblinCampTentSouth(), Anker.Anker.VillageSquare(), Anker.Anker.SquareWalkOutsideTavern(), Anker.Anker.SquareWalkOutsideStables(), Anker.Anker.RedLionStables(), Anker.Anker.SquareWalkCommerceCorner(), Anker.Anker.SquareWalkEastOfCentre(), Anker.Anker.SquareWalkEntrance(), Anker.Anker.SquareWalkSouthWestOfCentre(), Anker.Anker.SquareWalkWestOfCentre(), Anker.Anker.SquareWalkSouthOfCentre(), Anker.Anker.DrunkenSailor(), Anker.Anker.GeneralStore(), Anker.Anker.MetalMedley(), Anker.Anker.VillageHall(), Anker.Anker.VillageHallEntrance(), Anker.Anker.VillageHallEldersRoom(), Anker.Anker.TempleRoad(), Anker.Anker.TempleRoad2(), Anker.Anker.TempleEntrance(), Anker.Anker.PathToTheSquare(), Anker.Anker.AnkerLane(), Anker.Anker.AnkerLaneWest21(), Anker.Anker.AnkerLaneWest25(), Anker.Anker.AnkerLaneWest37(), Anker.Anker.AnkerLaneEast22(), Anker.Anker.AnkerLaneEast23(), Anker.Anker.AnkerLaneEast24(), Anker.Anker.AnkerHome(), Anker.Anker.AnkerHome2(), Anker.Anker.AnkerHome3(), Anker.Anker.AnkerHome4(), Anker.Anker.AnkerHome5(), Anker.Anker.AnkerHome6(), Anker.Anker.AnkerHome31(), Anker.Anker.AnkerHome32(), Anker.Anker.AnkerHome33(), Anker.Anker.AnkerHome34(), Anker.Anker.AnkerHome35(), Anker.Anker.AnkerHome36(), }; return(areas); }
public static List <Room> ListOfRooms() { var areas = new List <Room> { Ambush.TutorialRoom1(), Ambush.TutorialRoom2(), Ambush.TutorialLostInTheWoods(), Ambush.TutorialLostInTheWoods2(), Ambush.TutorialLostInTheWoods3(), Ambush.TutorialLostInTheWoods4(), Ambush.TutorialLostInTheWoods5(), Ambush.TutorialLostInTheWoods6(), Ambush.TutorialGoblinCamp(), Ambush.TutorialGoblinCampTentNorth(), Ambush.TutorialGoblinCampTentSouth(), Awakening.TempleOfTyr(), Anker.Anker.VillageSquare(), Anker.Anker.SquareWalkOutsideTavern(), Anker.Anker.SquareWalkOutsideStables(), Anker.Anker.RedLionStables(), Anker.Anker.SquareWalkCommerceCorner(), Anker.Anker.SquareWalkEastOfCentre(), Anker.Anker.SquareWalkEntrance(), Anker.Anker.SquareWalkSouthWestOfCentre(), Anker.Anker.SquareWalkWestOfCentre(), Anker.Anker.SquareWalkSouthOfCentre(), Anker.Anker.DrunkenSailor(), Anker.Anker.GeneralStore(), Anker.Anker.MetalMedley(), Anker.Anker.VillageHall(), Anker.Anker.VillageHallEntrance(), Anker.Anker.VillageHallEldersRoom(), Anker.Anker.TempleRoad(), Anker.Anker.TempleRoad2(), Anker.Anker.TempleRoad3(), Anker.Anker.TempleEntrance(), Anker.Anker.TempleOfTyr(), Anker.Anker.TempleRoad4(), Anker.Anker.TempleGraveyard(), Anker.Anker.TempleGraveyard1(), Anker.Anker.TempleGraveyard2(), Anker.Anker.TempleGraveyard3(), Anker.Anker.TempleGraveyard4(), Anker.Anker.TempleGraveyard5(), Anker.Anker.TempleGraveyard6(), Anker.Anker.PathToTheSquare(), Anker.Anker.AnkerLane(), Anker.Anker.AnkerLaneWest21(), Anker.Anker.AnkerLaneWest25(), Anker.Anker.AnkerLaneWest37(), Anker.Anker.AnkerLaneEast22(), Anker.Anker.AnkerLaneEast23(), Anker.Anker.AnkerLaneEast24(), Anker.Anker.AnkerHome(), Anker.Anker.AnkerHome2(), Anker.Anker.AnkerHome3(), Anker.Anker.AnkerHome4(), Anker.Anker.AnkerHome5(), Anker.Anker.AnkerHome6(), Anker.Anker.AnkerHome31(), Anker.Anker.AnkerHome32(), Anker.Anker.AnkerHome33(), Anker.Anker.AnkerHome34(), Anker.Anker.AnkerHome35(), Anker.Anker.AnkerHome36(), Anker.Anker.AnkerLaneEast40(), Anker.Anker.AnkerLaneGate(), Anker.AnkerFarm.AnkerRoad(), Anker.AnkerFarm.RoadThroughFarm(), Anker.AnkerFarm.Farm(), Anker.AnkerFarm.Windmill(), Anker.AnkerFarm.CropFields(), Anker.AnkerFarm.CropFields1(), Anker.AnkerFarm.CropFields2(), Anker.AnkerFarm.CropFields3(), Anker.AnkerFarm.AnkerRoad1(), Anker.AnkerFarm.AnkerRoad2(), Anker.AnkerFarm.AnkerRoad3(), Anker.AnkerFarm.RiverBank(), Anker.AnkerFarm.SawMill(), Anker.AnkerFarm.Pasture(), Anker.AnkerFarm.TheBridge(), Anker.AnkerFarm.PalusRiver(), Anker.AnkerFarm.PalusRiver0(), Anker.AnkerFarm.PalusRiver1(), Anker.AnkerFarm.PalusRiver2(), Anker.AnkerFarm.PalusRiver3(), Anker.AnkerFarm.HermitsHome(), }; return(areas); }
static void Main(string[] args) { //TODO: Clean up :) using (var db = new LiteDatabase(@"C:\MyData.db")) { var col = db.GetCollection <Room>("Room"); Console.WriteLine("Cleaning DB"); db.DropCollection("Room"); Console.WriteLine("Compiling Areas."); var areaSpeed = new Stopwatch(); areaSpeed.Start(); var areas = new List <Room> { Ambush.TutorialRoom1(), Ambush.TutorialRoom2(), Ambush.TutorialLostInTheWoods(), Ambush.TutorialLostInTheWoods2(), Ambush.TutorialLostInTheWoods3(), Ambush.TutorialLostInTheWoods4(), Ambush.TutorialLostInTheWoods5(), Ambush.TutorialLostInTheWoods6(), Ambush.TutorialGoblinCamp(), Ambush.TutorialGoblinCampTentNorth(), Ambush.TutorialGoblinCampTentSouth(), Awakening.TempleOfTyr(), Anker.VillageSquare(), Anker.SquareWalkOutsideTavern(), Anker.SquareWalkOutsideStables(), Anker.RedLionStables(), Anker.SquareWalkCommerceCorner(), Anker.SquareWalkEastOfCentre(), Anker.SquareWalkEntrance(), Anker.SquareWalkSouthWestOfCentre(), Anker.SquareWalkWestOfCentre(), Anker.SquareWalkSouthOfCentre(), Anker.DrunkenSailor(), Anker.GeneralStore(), Anker.MetalMedley(), Anker.VillageHall(), Anker.VillageHallEntrance(), Anker.VillageHallEldersRoom(), Anker.TempleRoad(), Anker.TempleRoad2(), Anker.TempleRoad3(), Anker.TempleEntrance(), Anker.PathToTheSquare(), Anker.AnkerLane(), Anker.AnkerLaneWest21(), Anker.AnkerLaneWest25(), Anker.AnkerLaneWest37(), Anker.AnkerLaneEast22(), Anker.AnkerLaneEast23(), Anker.AnkerLaneEast24(), Anker.AnkerHome(), Anker.AnkerHome2(), Anker.AnkerHome3(), Anker.AnkerHome4(), Anker.AnkerHome5(), Anker.AnkerHome6(), Anker.AnkerHome31(), Anker.AnkerHome32(), Anker.AnkerHome33(), Anker.AnkerHome34(), Anker.AnkerHome35(), Anker.AnkerHome36(), }; areaSpeed.Stop(); Console.WriteLine("Compiling Areas Completed in {0}ms.", areaSpeed.Elapsed.Milliseconds); //check areas for duplicate ids Console.WriteLine("Adding Area's to Database"); var addSpeed = new Stopwatch(); addSpeed.Start(); foreach (var area in areas) { Console.WriteLine("Added {0}", area.title); col.Insert(Guid.NewGuid(), area); } addSpeed.Stop(); Console.WriteLine("Adding Area's to Database Completed in {0}ms.", addSpeed.Elapsed.Milliseconds); Console.WriteLine("{0} Areas added", areas.Count); Console.ReadLine(); } }
static void Main(string[] args) { //TODO: Clean up :) const string ConnectionString = "mongodb://*****:*****@ds052968.mlab.com:52968/mimdb"; // Create a MongoClient object by using the connection string var client = new MongoClient(ConnectionString); //Use the MongoClient to access the server var database = client.GetDatabase("mimdb"); var roomCollection = database.GetCollection <Room>("Room"); Console.WriteLine("Cleaning DB"); database.DropCollection("Room"); Console.WriteLine("Compiling Areas."); var areaSpeed = new Stopwatch(); areaSpeed.Start(); var areas = new List <Room> { Ambush.TutorialRoom1(), Ambush.TutorialRoom2(), Ambush.TutorialLostInTheWoods(), Ambush.TutorialLostInTheWoods2(), Ambush.TutorialLostInTheWoods3(), Ambush.TutorialLostInTheWoods4(), Ambush.TutorialLostInTheWoods5(), Ambush.TutorialLostInTheWoods6(), Ambush.TutorialGoblinCamp(), Ambush.TutorialGoblinCampTentNorth(), Ambush.TutorialGoblinCampTentSouth(), Awakening.TempleOfTyr(), Anker.VillageSquare(), Anker.SquareWalkOutsideTavern(), Anker.SquareWalkOutsideStables(), Anker.RedLionStables(), Anker.SquareWalkCommerceCorner(), Anker.SquareWalkEastOfCentre(), Anker.SquareWalkEntrance(), Anker.SquareWalkSouthWestOfCentre(), Anker.SquareWalkWestOfCentre(), Anker.SquareWalkSouthOfCentre(), Anker.DrunkenSailor(), Anker.GeneralStore(), Anker.MetalMedley(), Anker.VillageHall(), Anker.VillageHallEntrance(), Anker.VillageHallEldersRoom(), Anker.TempleRoad(), Anker.TempleRoad2(), Anker.TempleEntrance(), Anker.PathToTheSquare(), Anker.AnkerLane(), Anker.AnkerLaneWest21(), Anker.AnkerLaneWest25(), Anker.AnkerLaneWest37(), Anker.AnkerLaneEast22(), Anker.AnkerLaneEast23(), Anker.AnkerLaneEast24(), Anker.AnkerHome(), Anker.AnkerHome2(), Anker.AnkerHome3(), Anker.AnkerHome4(), Anker.AnkerHome5(), Anker.AnkerHome6(), Anker.AnkerHome31(), Anker.AnkerHome32(), Anker.AnkerHome33(), Anker.AnkerHome34(), Anker.AnkerHome35(), Anker.AnkerHome36(), }; areaSpeed.Stop(); Console.WriteLine("Compiling Areas Completed in {0}ms.", areaSpeed.Elapsed.Milliseconds); //check areas for duplicate ids Console.WriteLine("Adding Area's to Database"); var addSpeed = new Stopwatch(); addSpeed.Start(); foreach (var area in areas) { Console.WriteLine("Added {0}", area.title); roomCollection.InsertOne(area); } addSpeed.Stop(); Console.WriteLine("Adding Area's to Database Completed in {0}ms.", addSpeed.Elapsed.Milliseconds); Console.WriteLine("{0} Areas added", areas.Count); Console.ReadLine(); }