Example #1
0
 public void RemoveCellblockTest()
 {
     Cellblock cellblock = new Cellblock("TestBlock");
     Cell cell = new Cell(4, 4, cellblock);
     cell.CellBlock = null;
     Assert.AreEqual(null, cell.CellBlock);
 }
Example #2
0
        public void Add(int maxPop, int pop, Cellblock cellblock)
        {
            LoadCellsFromDatabase();
            Cell cell = new Cell(maxPop, pop, cellblock);

            using (ISession session = NhibernateService.OpenSession())
            {
                using (ITransaction transaction = session.BeginTransaction())
                {
                    session.Save(cell);
                    transaction.Commit();
                }
            }
            LoadCellsFromDatabase();
            Notify();
        }
Example #3
0
 public void AddCellblockTest()
 {
     Cellblock cellblock = new Cellblock("TestBlock");
     Cell cell = new Cell(4, 4, cellblock);
     Assert.AreEqual("TestBlock", cell.CellBlock.Name);
 }
Example #4
0
 public Cell(int maxpop, int pop, Cellblock cellblock)
 {
     this.MaxPop = maxpop;
     this.Pop = pop;
     this.CellBlock = cellblock;
 }
Example #5
0
 public void AddCellblock(string name)
 {
     LoadCellsFromDatabase();
     Cellblock cb = new Cellblock(name);
     using (ISession session = NhibernateService.OpenSession())
     {
         using (ITransaction transaction = session.BeginTransaction())
         {
             session.Save(cb);
             transaction.Commit();
         }
     }
     LoadCellsFromDatabase();
     Notify();
 }