示例#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);
 }
示例#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();
        }
示例#3
0
 public void AddCellblockTest()
 {
     Cellblock cellblock = new Cellblock("TestBlock");
     Cell cell = new Cell(4, 4, cellblock);
     Assert.AreEqual("TestBlock", cell.CellBlock.Name);
 }
示例#4
0
 public Cell(int maxpop, int pop, Cellblock cellblock)
 {
     this.MaxPop = maxpop;
     this.Pop = pop;
     this.CellBlock = cellblock;
 }
示例#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();
 }