public void getShips(SpacegameServer.Core.Core _core, int _shipId, SpacegameServer.Core.User _user) { int DefaultUser = 0; int shipId1 = (int)_core.identities.shipLock.getNext(); SpacegameServer.Core.Ship Ship1; Ship1 = new SpacegameServer.Core.Ship(shipId1); Ship1.userid = DefaultUser; Ship1.posX = 5000; Ship1.posY = 5000; _core.ships[shipId1] = Ship1; _core.addShipToField(Ship1); ((SpacegameServer.Core.User)_core.users[DefaultUser]).ships.Add(Ship1); shipId1 = (int)_core.identities.shipLock.getNext(); Ship1 = new SpacegameServer.Core.Ship(shipId1); Ship1.userid = DefaultUser; Ship1.posX = 5001; Ship1.posY = 5001; _core.ships[shipId1] = Ship1; _core.addShipToField(Ship1); ((SpacegameServer.Core.User)_core.users[DefaultUser]).ships.Add(Ship1); }
public void getShipTemplates(SpacegameServer.Core.Core _core, int templateId, SpacegameServer.Core.User _user) { var newTemplateId = (int)_core.identities.templateLock.getNext(); var Template = Mock.mockShipTemplate(newTemplateId, 0); _core.shipTemplate.TryAdd(newTemplateId, Template); }
public void getUsersData(SpacegameServer.Core.Core _core) { getUsers(_core, 0); getUserStarMap(_core); getUserQuests(_core, null); getUserResearches(_core, null); getShipTemplates(_core, 0, null); getShipTemplatesModules(_core, null, false); getShips(_core, 0, null); getShipStock(_core, null, false); getShipModules(_core, null, false); getShipDirection(_core); getShipTranscension(_core); getShipTranscensionUsers(_core); getColonies(_core); getColonyStock(_core, null); getColonyBuildings(_core, null); getAlliances(_core, null); getAllianceMembers(_core); getDiplomaticEntityState(_core); getAllianceInvites(_core); getCommNodes(_core); getCommNodeUsers(_core); getCommunicationNodeMessage(_core); getCombat(_core); getCombatRounds(_core); }
public void getResearchs(SpacegameServer.Core.Core _core) { Research research = Mock.mockResearch(researchid: 1, description: "BaseResearch"); _core.Researchs[research.id] = research; research = Mock.mockResearch(researchid: 2, description: "Wasserkraftwerk"); _core.Researchs[research.id] = research; research = Mock.mockResearch(researchid: 9, description: "Ecosytem Adaption I"); _core.Researchs[research.id] = research; }
public void getShipHulls(SpacegameServer.Core.Core _core) { SpacegameServer.Core.ShipHullsImage ShipHullsImage = new SpacegameServer.Core.ShipHullsImage(); ShipHullsImage.id = 1; ShipHullsImage.shipHullId = 1; ShipHullsImage.objectId = 2; ShipHullsImage.templateImageId = 2; ShipHullsImage.templateModulesXoffset = 3; ShipHullsImage.templateModulesYoffset = 3; //ShipHull.ShipHullsImages.Add(ShipHullsImage); _core.ShipHullsImages.Add(ShipHullsImage); }
public void getGameData(SpacegameServer.Core.Core _core) { getGalaxyData(_core); getSpaceObjects(_core); getObjectsOnMap(_core); getObjectImages(_core); getObjectWeaponModificators(_core); getGoods(_core); getBuildings(_core); getBuildingProductions(_core); getBuildingCosts(_core); getPlanetTypes(_core); getShipHulls(_core); getShipHullsGain(_core); getShipHullsCosts(_core); getShipHullsModulePositions(_core); getShipHullsImages(_core); getModules(_core); getModulesGain(_core); getModulesCost(_core); getResearchQuestPrerequisites(_core); getSurfaceImages(_core); getSurfaceTiles(_core); getBuildOptions(_core); getQuests(_core); getResearchs(_core); getResearchsGain(_core); getObjectRelations(_core); getSurfaceDefaultMap(_core); getLanguages(_core); getLabels(_core); //MAP getStars(_core); getSolarSystemInstances(_core); getPlanetSurface(_core); }
public void getCommNodes(SpacegameServer.Core.Core _core) { var commNodeId = (int)_core.identities.commNode.getNext(); int DefaultUser = 0; CommunicationNode node = new CommunicationNode(commNodeId); node.userId = DefaultUser; node.positionX = 5000; node.positionY = 5000; node.sysX = null; node.sysY = null; node.connectionType = 0; node.connectionId = _core.ships.First().Key; node.activ = true; node.unformattedName = ""; node.name = ""; _core.commNodes.TryAdd(commNodeId, node); SpacegameServer.Core.NodeQuadTree.Field commNodeField = new SpacegameServer.Core.NodeQuadTree.Field(node.positionX, node.positionY); _core.nodeQuadTree.insertNode(commNodeField, node.id); commNodeId = (int)_core.identities.commNode.getNext(); node = new CommunicationNode(commNodeId); node.userId = DefaultUser; node.positionX = 5001; node.positionY = 5001; node.sysX = null; node.sysY = null; node.connectionType = 0; node.connectionId = _core.ships[1].id; node.activ = true; node.unformattedName = ""; node.name = ""; _core.commNodes.TryAdd(commNodeId, node); commNodeField = new SpacegameServer.Core.NodeQuadTree.Field(node.positionX, node.positionY); _core.nodeQuadTree.insertNode(commNodeField, node.id); }
//GetAll.cs public void getAll(SpacegameServer.Core.Core _core) { //save the TestDataConnector DataConnector connectorTest = _core.dataConnection; //Read Game Data with sql connector DataConnector connector = new SpacegameServer.DataConnectors.SqlConnector(); _core.dataConnection = connector; _core.dataConnection.getGameData(_core); //important: Set Data COnnection back to TestDataconnection, so that following write2DB are just skipped _core.dataConnection = connectorTest; //TestDataConnector will Mock user data for player 0 _core.dataConnection.getUsersData(_core); //User Data Contains some Data of player 0 }
public void TestLockable() { SpacegameServer.Core.Core Instance = SpacegameServer.Core.Core.Instance; SpacegameServer.Core.User x = Mock.MockUserAndAdd(Instance); int shipId1 = (int)Instance.identities.shipLock.getNext(); int shipId2 = (int)Instance.identities.shipLock.getNext(); SpacegameServer.Core.Ship Ship1, Ship2; Ship1 = new SpacegameServer.Core.Ship(shipId1); Ship2 = new SpacegameServer.Core.Ship(shipId2); SpacegameServer.Core.Colony Colony1; Colony1 = new SpacegameServer.Core.Colony(1); //Object can only be locked once Assert.IsTrue(Ship1.setLock()); Assert.IsFalse(Ship1.setLock()); //LockAll of Ships can only be set once Assert.IsTrue(SpacegameServer.Core.Ship.setLockAll()); Assert.IsFalse(SpacegameServer.Core.Ship.setLockAll()); //ships can't be lcoked anymore, colonies can Assert.IsFalse(Ship1.setLock()); Assert.IsFalse(Ship2.setLock()); Assert.IsTrue(Colony1.setLock()); Ship1.removeLock(); Colony1.removeLock(); //after removing LockAll, all is lockable again SpacegameServer.Core.Ship.removeLockAll(); Assert.IsTrue(Ship1.setLock()); Assert.IsTrue(Ship2.setLock()); Assert.IsTrue(Colony1.setLock()); }
public void getGalaxyData(SpacegameServer.Core.Core _core) { }
public void getSpaceObjects(SpacegameServer.Core.Core _core) { }
public void getUsersData(SpacegameServer.Core.Core _core) { }
public void getUsersRefresh(SpacegameServer.Core.Core _core) { }
public void getBuildings(SpacegameServer.Core.Core _core) { }
public void getMessageHeads(SpacegameServer.Core.Core _core) { }
public void saveResearch(SpacegameServer.Core.Core instance, SpacegameServer.Core.Research research = null) { }
public void getObjectWeaponModificators(SpacegameServer.Core.Core _core) { }
public void getChatLog(SpacegameServer.Core.Core _core) { }
public void getCombatRounds(SpacegameServer.Core.Core _core) { }
public void getShipRefits(SpacegameServer.Core.Core _core) { }
public void getMessageBody(SpacegameServer.Core.Core _core) { }
public void getMessageParticipants(SpacegameServer.Core.Core _core) { }
public void getObjectsOnMap(SpacegameServer.Core.Core _core) { }
public void SaveUserResearch(SpacegameServer.Core.Core instance, SpacegameServer.Core.User user, List <SpacegameServer.Core.UserResearch> NewUserResearch, List <SpacegameServer.Core.UserQuest> NewQuests) { }
public void getObjectImages(SpacegameServer.Core.Core _core) { }
//GetAll.cs public void getAll(SpacegameServer.Core.Core _core) { }
public void getGoods(SpacegameServer.Core.Core _core) { }
public void GetTurnEvaluations(SpacegameServer.Core.Core _core) { }
public void SaveUserQuests(SpacegameServer.Core.Core instance, List <SpacegameServer.Core.UserQuest> quests) { }
public void getCommunicationNodeMessage(SpacegameServer.Core.Core _core) { }