Пример #1
0
        public IActionResult Detail(int id)
        {
            Name objTest = new Name();

            objTest = NameDB.GetName(id);
            return(View(objTest));
        }
    protected void Button1_Click(object sender, EventArgs e)
    {
        Names.Add("dss");

        GridView1.DataSource = Names.GetName();
        GridView1.DataBind();
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        Names = new NameDB();    //Instantiation
        Names.Add("dss");

        GridView1.DataSource = Names.GetName();
        GridView1.DataBind();
    }
Пример #4
0
 public NameIcon(ref EntityState entityState, GlobalUIState state) : base(entityState.Entity.GetDataBlob <PositionDB>())
 {
     _state               = state;
     _entityGuid          = entityState.Entity.Guid;
     _nameDB              = entityState.Entity.GetDataBlob <NameDB>();
     NameString           = _nameDB.GetName(state.Faction);
     entityState.Name     = NameString;
     entityState.NameIcon = this;
 }
Пример #5
0
        public NameIcon(EntityState entityState, GlobalUIState state) : base(entityState.Entity.GetDataBlob <PositionDB>())
        {
            _state      = state;
            _entityGuid = entityState.Entity.Guid;
            StarSystem starsys = (StarSystem)entityState.Entity.Manager;

            _starSysGuid         = starsys.Guid;
            _nameDB              = entityState.Entity.GetDataBlob <NameDB>();
            NameString           = _nameDB.GetName(state.Faction);
            entityState.Name     = NameString;
            entityState.NameIcon = this;
            _bodyType            = entityState.BodyType;
        }
Пример #6
0
        public void CreateNewFaction()
        {
            string factionName = "Terran";

            Entity faction = FactionFactory.CreateFaction(_game, factionName);
            NameDB nameDB  = faction.GetDataBlob <NameDB>();

            Assert.IsTrue(nameDB.GetName(faction) == factionName);

            Entity factioncopy = faction.Clone(faction.Manager);

            Assert.IsTrue(faction.GetValueCompareHash() == factioncopy.GetValueCompareHash(), "Hashes don't match");
        }
Пример #7
0
        public void CreateClassAndShip()
        {
            Entity     faction    = FactionFactory.CreateFaction(_game, "Terran");
            StarSystem starSystem = new StarSystem(_game, "Sol", -1);

            string shipClassName = "M6 Corvette";       //X Universe ;3
            string shipName      = "USC Winterblossom"; //Still X Universe

            var requiredDataBlobs = new List <Type>()
            {
                typeof(ShipInfoDB),
                typeof(ArmorDB),
                typeof(BeamWeaponsDB),
                typeof(BuildCostDB),
                typeof(CargoStorageDB),
                typeof(CrewDB),
                typeof(DamageDB),
                typeof(HangerDB),
                typeof(IndustryDB),
                typeof(MaintenanceDB),
                typeof(MissileWeaponsDB),
                typeof(PowerDB),
                typeof(PropulsionDB),
                typeof(SensorProfileDB),
                typeof(SensorsDB),
                typeof(ShieldsDB),
                typeof(TractorDB),
                typeof(TroopTransportDB),
                typeof(NameDB)
            };

            Entity     shipClass       = ShipFactory.CreateNewShipClass(_game, faction, shipClassName);
            ShipInfoDB shipClassInfo   = shipClass.GetDataBlob <ShipInfoDB>();
            NameDB     shipClassNameDB = shipClass.GetDataBlob <NameDB>();

            //Assert.IsTrue(HasAllRequiredDatablobs(shipClass, requiredDataBlobs), "ShipClass Entity doesn't contains all required datablobs");
            Assert.IsTrue(shipClassInfo.ShipClassDefinition == Guid.Empty, "Ship Class ShipInfoDB must have empty ShipClassDefinition Guid");
            Assert.IsTrue(shipClassNameDB.GetName(faction) == shipClassName);

            /////Ship/////
            Vector4    pos        = new Vector4(0, 0, 0, 0);
            Entity     ship       = ShipFactory.CreateShip(shipClass, starSystem.SystemManager, faction, pos, starSystem, shipName);
            ShipInfoDB shipInfo   = ship.GetDataBlob <ShipInfoDB>();
            NameDB     shipNameDB = ship.GetDataBlob <NameDB>();

            //Assert.IsTrue(HasAllRequiredDatablobs(ship, requiredDataBlobs), "Ship Entity doesn't contains all required datablobs");
            Assert.IsTrue(shipInfo.ShipClassDefinition == shipClass.Guid, "ShipClassDefinition guid must be same as ship class entity guid");
            Assert.IsTrue(shipNameDB.GetName(faction) == shipName);
        }
Пример #8
0
        public void CreateNewFaction()
        {
            string factionName = "Terran";

            var requiredDataBlobs = new List <Type>()
            {
                typeof(FactionInfoDB),
                typeof(FactionAbilitiesDB),
                typeof(NameDB),
                typeof(FactionTechDB)
            };

            Entity faction = FactionFactory.CreateFaction(_game, factionName);
            NameDB nameDB  = faction.GetDataBlob <NameDB>();
            //FactionDB factionDB = faction.GetDataBlob<FactionDB>();
            Entity factioncopy = faction.Clone(faction.Manager);

            //Assert.IsTrue(HasAllRequiredDatablobs(faction, requiredDataBlobs));
            Assert.IsTrue(nameDB.GetName(faction) == factionName);
        }
        // 3. ************* EDIT NAME DETAILS ******************
        // GET: Name/Edit/3

        public IActionResult Edit(int id)
        {
            Name objTest = new Name();
            objTest= NameDB.GetName(id);
            return View(objTest);
        }