/// <summary> /// Prepares the model. /// </summary> /// <param name="space">The space.</param> public void PrepareTheModel(SpaceModel space, ILogBuilder log) { foreach (FeatureWeightFactor gf in GlobalFactors) { if (DoShareAnalyticData) { SharedDataPool.TryToGet(gf.GlobalFunction, log); } gf.GlobalFunction.PrepareTheModel(space, log); gf.GlobalFunction.DoIndexNormalization(log); if (gf.GlobalFunction.resultType == FunctionResultTypeEnum.numericVectorForMultiClass) { nDimensions = space.labels.Count; resultType = gf.GlobalFunction.resultType; } if (DoShareAnalyticData) { SharedDataPool.TryToSet(gf.GlobalFunction, log); } } if (DoUseLocalFunction) { LocalFunction.PrepareTheModel(space, log); } if (!GlobalFactors.Any()) { log.log("WARNING: NO GLOBAL FACTORS DEFINED AT FEATURE WEIGHT MODEL"); } }
public WeightDictionaryEntry GetElementFactorEntry(string term, SpaceModel space, SpaceLabel label = null) { WeightDictionaryEntry output = new WeightDictionaryEntry(term, 0); switch (resultType) { case FunctionResultTypeEnum.numeric: output = new WeightDictionaryEntry(term, GetElementFactor(term, space, label)); break; case FunctionResultTypeEnum.numericVectorForMultiClass: Double[] vec = new double[space.labels.Count]; Int32 c = 0; foreach (SpaceLabel lb in space.labels) { vec[c] = GetElementFactor(term, space, lb); c++; } output = new WeightDictionaryEntry(term, vec); // output.AddEntry(term, vec); break; } if (!DistinctReturns.ContainsKey(output.weight)) { DistinctReturns.Add(output.weight, term); } return(output); }
private static List <SpaceModel> MapLinedraw(SpaceModel start, SpaceModel end, MapModel map) { CubeCoord a = CoordinatesToCubeCoords(start); CubeCoord b = CoordinatesToCubeCoords(end); double N = CubeDistance(a, b); List <SpaceModel> results = new List <SpaceModel>(); if (Math.Abs(N) > Double.Epsilon) { for (int i = 0; i <= N; i++) { CubeCoord coord = RoundCubeCoords(CubeLerp(a, b, 1 / N * i)); DoubledCoord normalCoord = CubeCoordsToCoordinates(coord); SpaceModel newSpace; newSpace = map.GetSpace(normalCoord.Row, normalCoord.Column); if (newSpace != null) { results.Add(newSpace); } } } return(results); }
/// <summary> /// 获取用户在soft_time表设置的限定容量 /// </summary> /// <returns>KB为单位的总可用容量</returns> public int getMark4() { //获取token string token = FinanceToken.getFinanceCheckToken().getToken(); //获取对象 Account account = FinanceToken.getFinanceCheckToken().checkToken(token); SpaceModel spaceModel = new SpaceModel(); control_soft_time user = spaceModel.getUserSpaceInfo(account.company); if (user != null) { if (user.mark4 != null) { return(int.Parse(user.mark4.Trim()) * 1024); } else { return(0); } } else { return(0); } }
public void SpawnPirate(SpaceModel spawnPoint) { //If the pirate is dead check type and create a new one if (pirateModel == null && !spawnPoint.Occupied()) { switch (pirateType) { case PirateModel.PirateType.Scout: pirateModel = PirateModel.CreateScoutPirate(spawnPoint, this); break; case PirateModel.PirateType.Frigate: pirateModel = PirateModel.CreateFrigatePirate(spawnPoint, this); break; case PirateModel.PirateType.Platform: pirateModel = PirateModel.CreatePlatformPirate(spawnPoint, this); break; case PirateModel.PirateType.Dreadnought: pirateModel = PirateModel.CreateDreadnaughtPirate(spawnPoint, this); break; case PirateModel.PirateType.Destroyer: pirateModel = PirateModel.CreateDestroyerPirate(spawnPoint, this); break; } Dispatcher.InvokeAsync(() => { modelLink.CreatePirateView(pirateModel); spawnPoint.OccupySpace(pirateModel); }); } }
public WeightDictionaryEntry GetElementFactorEntry(string term, SpaceModel space, SpaceLabel label = null) { Double score = GetElementFactor(term, space, label); WeightDictionaryEntry entry = new WeightDictionaryEntry(term, score); return(entry); }
public async Task <IActionResult> Edit(int id, [Bind("SpaceModelId,Name,Address,LocalAdministratorModelId")] SpaceModel spaceModel) { if (id != spaceModel.SpaceModelId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(spaceModel); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SpaceModelExists(spaceModel.SpaceModelId)) { return(NotFound()); } else { throw; } } return(RedirectToAction("Index", "Home")); } ViewData["LocalAdministratorModelId"] = new SelectList(_context.Lokalni, "AdministratorModelId", "Discriminator", spaceModel.LocalAdministratorModelId); return(View(spaceModel)); }
// Use this for initialization. Starting method for our code. public void Start() { //Get the path of the Game data folder string m_Path = Application.dataPath; tradeGUIController = dockUI.GetComponent <TradeGUIController>(); stationModel = new StationModel(tradeGUIController); //Creates the sound view and sound controller. this.soundView = UnityEngine.Object.Instantiate(this.soundView); // Gets the controller from the musicView GameObject. this.soundController = this.soundView.GetComponent <SoundController>(); // Lets the Controller access the GameObject this.soundController.SetSoundView(this.soundView); this.soundController.SetSliders(this.musicSlider, this.sfxSlider); //Output the Game data path to the console this.modelLink = new ModelLink(this, mapGameObject, stationModel); // Creates the map. this.MapControllerField = new MapController(125, 250, modelLink, this, stationModel); // Gets a starting space for the player, based on coordinates. Moving away from coordinates, but they are fine for setup SpaceModel playerSpace = MapControllerField.Map.GetSpace(63, 125); // Create a player, and set up MVC connections this.playerModel = new PlayerModel(playerSpace, MapControllerField.Map, this, stationModel); modelLink.CreatePlayerView(playerModel, playerMovementText, currency, metal, organics, gas, water, fuel, fuelMax, totalSpace); MapControllerField.Map.CreateHunterKiller(playerModel, this); }
public void ProjectTopics(SpaceModel space) { for (int k = 0; k < settings.K; k++) { var wordsProbsList = new Dictionary <int, double>(); for (int w = 0; w < space.terms_known_label.Count; w++) { wordsProbsList.Add(w, phi[k][w]); } double ans = 0; for (int w = 0; w < space.terms_known_label.Count; w++) { ans += phi[k][w]; } if (Math.Abs(ans - 1.00) > 0.1) { throw (new Exception("Phi Calculation Error")); } //sw.Write("Topic " + k + "th:\n"); var wordsProbsListOrdered = wordsProbsList.OrderBy(e => - e.Value).ToList(); //for (int i = 0; i < tw; i++) //{ // string word = cor.GetStringByID(wordsProbsListOrdered[i].Key); // sw.WriteLine("\t" + word + " " + wordsProbsListOrdered[i].Value); //} } }
///// <summary> ///// Normalization divisor for document ///// </summary> ///// <value> ///// The index of the TFN. ///// </value> //protected Dictionary<SpaceDocumentModel, Double> TFN_index { get; set; } = new Dictionary<SpaceDocumentModel, Double>(); public override void PrepareTheModel(SpaceModel _space, ILogBuilder log) { var space = _space; TokenDictionary training_terms = space.GetTerms(true, true); List <SpaceLabel> labels = space.labels.ToList(); shortName = GetFunctionName(computation); if (!IsEnabled) { return; } switch (computation) { case TFComputation.modifiedTF: SqrTc = Math.Sqrt(training_terms.GetSumFrequency()); break; default: //foreach (SpaceDocumentModel document in space.documents) //{ // TFN_index.Add(document, GetDivisor(document)); //} break; } index = training_terms.ToFrequencyDictionary(); }
public FeatureSelectionAnalysis(String _name, SpaceModel _space, FeatureFilter _filter, Int32 _FSl) { name = _name; //space = _space.Clone(); inputTerms = _space.terms.Clone(); filter = _filter.CloneViaXML(); filter.limit = _FSl; }
public void CreateLaser(SpaceModel start, SpaceModel end, ShipModel enemy) { Dispatcher.InvokeAsync(() => { var laser = UnityEngine.Object.Instantiate(laserPrefab) as GameObject; laser.GetComponent <Laser>().SetLine(start.GetController().GetPosition(), end.GetController().GetPosition(), shipModel, enemy); }); }
// Helper algorithims private static CubeCoord CoordinatesToCubeCoords(SpaceModel space) { double x = (space.Column - space.Row) / 2; double z = space.Row; double y = -x - z; return(new CubeCoord(x, y, z)); }
private SpaceModel<SpaceObject> MakeBurningPlanet() { var spaceModel = new SpaceModel<SpaceObject>(); var planet = new StaticHiResObject(Vector3.Backward * 150, "Planets/PlanetBurning", 4.0f, 0.0003f, Vector3.Up); var star = new StarObject(Vector3.Zero, 120, 0.001f, 0.3f, 0.98f, 0.1f); spaceModel.AddSpaceObject(planet); spaceModel.AddSpaceObject(star); return spaceModel; }
public Station GetStation(SpaceModel space) { try { return(allStations[space]); } catch (KeyNotFoundException) { return(null); } }
public SpaceModel GetE(SpaceModel startSpace) { int newSpaceRow = startSpace.Row; int newSpaceColumn = startSpace.Column + 2; if (newSpaceColumn >= columns) { return(null); } return(map[newSpaceRow][newSpaceColumn]); }
public SpaceModel GetSE(SpaceModel startSpace) { int newSpaceRow = startSpace.Row + 1; int newSpaceColumn = startSpace.Column + 1; if (newSpaceRow >= rows || newSpaceColumn >= columns) { return(null); } return(map[newSpaceRow][newSpaceColumn]); }
public SpaceModel GetNW(SpaceModel startSpace) { int newSpaceRow = startSpace.Row - 1; int newSpaceColumn = startSpace.Column - 1; if (newSpaceRow < 0 || newSpaceColumn < 0) { return(null); } return(map[newSpaceRow][newSpaceColumn]); }
public void CreateStation(SpaceModel stationLocation, StationType stationType, ModelLink link) { //int reset = 999; GenerateStationResources(StationType.Reset); GenerateStationResources(stationType); // IF THE LOADING TIME TAKES TOO LONG, THIS NEEDS TO BE DONE ONLY WHEN A STATION IS DOCKED AT Station newStation = new Station(stationLocation, stationType, metalAvailable, metalPrice, organicAvailable, organicPrice, fuelAvailable, fuelPrice, gasAvailable, gasPrice, waterAvailable, waterPrice, this); link.CreateStationView(newStation); allStations.Add(stationLocation, newStation); }
/// <summary> /// Gets the element factor. /// </summary> /// <param name="term">The term.</param> /// <param name="space">The space.</param> /// <param name="label">The label.</param> /// <returns></returns> public override double GetElementFactor(string term, SpaceModel space, SpaceLabel label = null) { // SpaceLabel label = DocumentVsLabel[document]; Double output = 0; List <String> labelNames = new List <string>(); if (label == null) { if (index.ContainsKey(term)) { return(index[term]); } else { return(0); } //labelNames = computedModel.index.Keys.ToList(); } else { labelNames.Add(label.name); } List <Double> scores = new List <double>(); foreach (String ln in labelNames) { var d = GetElementFactor(term, ln); scores.Add(d); } output = operationExtensions.CompressNumericVector(scores.ToArray(), defaultOperation); /* * if (!computedModel.index.ContainsKey(label.name)) return 0; * * if (!computedModel.index[label.name].ContainsKey(term)) return 0; */ //TermDiscriminatingPower TDP = model[label.name][term]; //output = TDP.Compute(factor, N); //output = computedModel.index[label.name][term]; return(output); }
// Creates the view and gets the controller for a Space public void CreateSpaceView(SpaceModel spaceModel) { // Creates the space GameObject in the correct position. Formula works for hexes GameObject spaceView = UnityEngine.Object.Instantiate(GameController.GetSpaceView(), new Vector2((float)spaceModel.Column * 0.6f, (0 - spaceModel.Row * 1.04f)), Quaternion.identity, MapContainer); // Gets the controller from the GameObject. SpaceController spaceController = spaceView.GetComponent <SpaceController>(); // Lets the Controller access the GameObject spaceController.SetSpaceView(spaceView); // Lets the Controller access the Model spaceController.SetSpace(spaceModel); // Lets the Model access the Controller, as a callback spaceModel.SetController(spaceController); }
public void Pursuit() { int currentSpaceOnPursuitPath = 0; SpaceModel target = playerPursuing.GetSpace(); PlayerModel playerScan; List <SpaceModel> targetPath = new List <SpaceModel>(); targetPath.AddRange(AStarPathfinding.GetPathToDestination(pirateModel.GetSpace(), target)); // Oisín Notes: Add a for loop here, and checks for if the player is in range? for (int i = 0; i < (pirateModel.GetMaxMovement()); i++) { { playerScan = GetPlayerPursuit(); if (playerScan != null) { i = (pirateModel.GetMaxMovement()); } else { int nextSpace = currentSpaceOnPursuitPath + 1; if (nextSpace == targetPath.Count) { nextSpace = 0; } while (targetPath[nextSpace].GetMovementCost() > 99) { i += targetPath[nextSpace].GetNormalMovementCost() - 1; nextSpace++; if (nextSpace == targetPath.Count) { nextSpace = 0; } } i += targetPath[nextSpace].GetMovementCost() - 1; if (i <= (pirateModel.GetMaxMovement())) { currentSpaceOnPursuitPath = nextSpace; pirateModel.UpdatePirateLocation(targetPath[currentSpaceOnPursuitPath]); } } } Dispatcher.InvokeAsync(() => { pirateModel.GetController().MoveShip(targetPath, pirateModel, playerScan); }); } }
/// <summary> /// Gets the product of global element factors /// </summary> /// <param name="term">The term.</param> /// <param name="space">The space.</param> /// <param name="label">The label.</param> /// <returns></returns> public double GetElementFactor(string term, SpaceModel space, SpaceLabel label = null) { Double GF = 1; foreach (FeatureWeightFactor gf in GlobalFactors) { GF = GF * (gf.GlobalFunction.GetElementFactor(term, space, label) * gf.weight); } //if (Double.IsInfinity(GF)) //{ //} return(GF); }
public Station(SpaceModel stationLocation, StationModel.StationType newStationType, int newMetalAvail, int newMetalPrice, int newOrganicAvail, int newOrganicPrice, int newFuelAvail, int newFuelPrice, int newGasAvail, int newGasPrice, int newWaterAvail, int newWaterPrice, StationModel stationModel) { this.stationModel = stationModel; this.currentStation = stationLocation; stationType = newStationType; metalAvailable = newMetalAvail; metalPrice = newMetalPrice; organicAvailable = newOrganicAvail; organicPrice = newOrganicPrice; fuelAvailable = newFuelAvail; fuelPrice = newFuelPrice; gasAvailable = newGasAvail; gasPrice = newGasPrice; waterAvailable = newWaterAvail; waterPrice = newWaterPrice; }
private int DoSampling(int i, SpaceModel space) { int oldZ = TotalWordToTopic[i]; int w = Words[i]; // //words[i]; int d = TotalWordToDocument[i]; WordToTopic[w][oldZ] -= 1; dt[d][oldZ] -= 1; nwsum[oldZ] -= 1; ndsum[d] -= 1; double Vbeta = space.terms_known_label.Count * settings.eta; // Beta; double Kalpha = settings.K * settings.alpha; // Alpha; for (int k = 0; k < settings.K; k++) { p[k] = (WordToTopic[w][k] + settings.eta) / (nwsum[k] + Vbeta) * (dt[d][k] + settings.alpha) / (ndsum[d] + Kalpha); } for (int k = 1; k < settings.K; k++) { p[k] += p[k - 1]; } Random rnd = new Random(); double cp = rnd.NextDouble() * p[settings.K - 1]; int newZ; for (newZ = 0; newZ < settings.K; newZ++) { if (p[newZ] > cp) { break; } } if (newZ == settings.K) { newZ--; } WordToTopic[w][newZ] += 1; dt[d][newZ] += 1; nwsum[newZ] += 1; ndsum[d] += 1; return(newZ); }
public void DeployAndRun(ILogBuilder log, SpaceModel _space, folderNode folder) { filter.Deploy(log, folder); weightedFeatures = new WeightDictionary(name + "_weg" + filter.limit.ToString(), "weighted features, before filter"); selectedFeatures = new WeightDictionary(name + "_sel" + filter.limit.ToString(), "selected weighted featyres"); var selected = filter.SelectFeatures(_space, log, folder, weightedFeatures); foreach (var pair in selected) { selectedFeatures.AddEntry(pair.Key, pair.Value); } weightedFeatures.Save(folder, log, WeightDictionary.GetDictionaryFilename(weightedFeatures.name, folder)); selectedFeatures.Save(folder, log, WeightDictionary.GetDictionaryFilename(selectedFeatures.name, folder)); }
protected void CalcParameter(SpaceModel space) { for (int m = 0; m < space.documents.Count; m++) { for (int k = 0; k < settings.K; k++) { theta[m][k] = (dt[m][k] + settings.alpha) / (ndsum[m] + settings.K * settings.alpha); } } for (int k = 0; k < settings.K; k++) { for (int w = 0; w < space.terms_known_label.Count; w++) { phi[k][w] = (WordToTopic[w][k] + settings.eta) / (nwsum[k] + space.terms_known_label.Count * settings.eta); } } }
// Create a node on a space. Special constructor for A* nodes, includes guess of remaining distance public PathfindingNode(SpaceModel space, PathfindingNode parent, int cost, double pathfindingCost, bool seen, SpaceModel destination) { thisSpace = space; this.cost = cost; this.parent = parent; this.seen = seen; this.pathfindingCost = pathfindingCost; if (destination != null) { // Spaces Up/Down (UD) + // Spaces Side - (UD) / 2 (Min 0) // This section gets the minimum distance between two points on our hex map. int vertical = Math.Abs(space.Row - destination.Row); int furtherHorizontal = Math.Max(Math.Abs(space.Column - destination.Column) - vertical, 0) / 2; ASRemaining = vertical + furtherHorizontal; } }
//pirate ship builder template public PirateModel(SpaceModel location, PirateType type, int health, int shotDamage, int detectRange, int attackRange, int maxPirateMovement, int shotCounter, PirateAiModel pirateAi) { // The "base" for these are unnecessary, but it helps keep them seperate. Base gets the superclass base.currentSpace = location; this.type = type; base.shipHealth = health; base.maxHealth = health; base.shotDamage = shotDamage; this.playerDetectRange = detectRange; base.attackRange = attackRange; base.maxMovement = maxPirateMovement; base.currentMovement = maxPirateMovement; base.shotCounter = shotCounter; base.currentShotCounter = shotCounter; this.pirateAi = pirateAi; base.shipArmor = 0; }
/// <summary> /// Constructs global weight fictionary using global elements /// </summary> /// <param name="terms">The terms.</param> /// <param name="space">The space.</param> /// <param name="label">The label.</param> /// <returns></returns> public WeightDictionary GetElementFactors(IEnumerable <string> terms, SpaceModel space, SpaceLabel label = null) { var output = new WeightDictionary(); output.name = GetSignature() + "_globalOnly"; foreach (String term in terms) { Double score = GetElementFactor(term, space, label); WeightDictionaryEntry entry = new WeightDictionaryEntry(term, score); output.AddEntry(entry, true); } output.description = "Global weights for [" + output.Count + "] terms."; return(output); }
public void DeployDataSet(IEnumerable <WebSiteDocumentsSet> _dataset, ILogBuilder log) { if (IsDatasetDeployed) { log.log("DataSet deployement called on already deployed context!"); } dataset = new Dictionary <string, WebSiteDocumentsSet>(); webSiteByDomain = new Dictionary <string, WebSiteDocuments>(); webDocumentByAssignedID = new Dictionary <string, WebSiteDocument>(); spaceLabelsDomains = new Dictionary <string, SpaceLabel>(); spaceModel = new SpaceModel(); spaceLabels = new Dictionary <string, SpaceLabel>(); dataSetSignature = _dataset.GetDataSetSignature(); if (_dataset is ExperimentDataSetFold _fold) { name = _fold.name; } else { name = dataSetSignature; } UnlabeledSites = _dataset.GetUnlabeledDataSet(); List <WebSiteDocumentsSet> inputSets = _dataset.ToList(); if (UnlabeledSites != null) { inputSets.Remove(UnlabeledSites); inputSets.Insert(0, UnlabeledSites); } foreach (WebSiteDocumentsSet set in inputSets) { DeployCategory(set); } }
private SpaceModel<SpaceObject> MakeMainMenuModel() { var spaceModel = new SpaceModel<SpaceObject>(); var star = new StarObject(new Vector3(0, 0, 0), 10); spaceModel.AddSpaceObject(star); var mainPlanet1 = new OrbitingPlanetObject(new Orbit(star, new Vector3(40, 40, 40), 0.01f), 3f); var mainPlanet2 = new OrbitingPlanetObject(new Orbit(star, new Vector3(30, -40, 10), 0.01f), 4f); var mainPlanet3 = new OrbitingPlanetObject(new Orbit(star, new Vector3(30, 20, -20), 0.01f), 5f); var mainPlanet4 = new OrbitingPlanetObject(new Orbit(star, new Vector3(-10, -10, 10), 0.03f), 2f); spaceModel.AddSpaceObject(mainPlanet1); spaceModel.AddSpaceObject(mainPlanet2); spaceModel.AddSpaceObject(mainPlanet3); spaceModel.AddSpaceObject(mainPlanet4); var moon1 = new OrbitingPlanetObject(new Orbit(mainPlanet3, new Vector3(4, 4, 4), 0.1f), 0.35f); var moon2 = new OrbitingPlanetObject(new Orbit(mainPlanet3, new Vector3(-3, -8, -1), 0.1f), 0.45f); var moon3 = new OrbitingPlanetObject(new Orbit(mainPlanet3, new Vector3(-5, -2, 3), 0.1f), 0.2f); var moon4 = new OrbitingPlanetObject(new Orbit(mainPlanet3, new Vector3(3, 8, 1), 0.1f), 0.45f); var moon5 = new OrbitingPlanetObject(new Orbit(mainPlanet1, new Vector3(-5, -1, 3), 0.1f), 0.2f); var moon6 = new OrbitingPlanetObject(new Orbit(mainPlanet1, new Vector3(3, 2, -2), 0.1f), 0.55f); spaceModel.AddSpaceObject(moon1); spaceModel.AddSpaceObject(moon2); spaceModel.AddSpaceObject(moon3); spaceModel.AddSpaceObject(moon4); spaceModel.AddSpaceObject(moon5); spaceModel.AddSpaceObject(moon6); return spaceModel; }
private SpaceModel<SpaceObject> MakeFastSolarSystem() { var spaceModel = new SpaceModel<SpaceObject>(); var star = new StarObject(new Vector3(0, 0, 0), 10); spaceModel.AddSpaceObject(star); float orbM = 10; float sizM = 5; float speedM = 0.4f; var moon1 = new OrbitingPlanetObject(new Orbit(star, new Vector3(4, 4, 4) * orbM, 0.1f * speedM), 0.35f * sizM); var moon2 = new OrbitingPlanetObject(new Orbit(star, new Vector3(-3, -8, -1) * orbM, 0.1f * speedM), 0.45f * sizM); var moon3 = new OrbitingPlanetObject(new Orbit(star, new Vector3(-5, -2, 3) * orbM, 0.1f * speedM), 0.2f * sizM); var moon4 = new OrbitingPlanetObject(new Orbit(star, new Vector3(3, 8, 1) * orbM, 0.1f * speedM), 0.45f * sizM); var moon5 = new OrbitingPlanetObject(new Orbit(star, new Vector3(-5, -1, 3) * orbM, 0.1f * speedM), 0.2f * sizM); var moon6 = new OrbitingPlanetObject(new Orbit(star, new Vector3(3, 2, -2) * orbM, 0.1f * speedM), 0.55f * sizM); spaceModel.AddSpaceObject(moon1); spaceModel.AddSpaceObject(moon2); spaceModel.AddSpaceObject(moon3); spaceModel.AddSpaceObject(moon4); spaceModel.AddSpaceObject(moon5); spaceModel.AddSpaceObject(moon6); return spaceModel; }
private SpaceModel<SpaceObject> MakeOrbitingButtons() { var spaceModel = new SpaceModel<SpaceObject>(); var star = new StarObject(Vector3.Zero, 2f); var debris1 = new OrbitingPlanetObject(new Orbit(star, new Vector3(3.5f, 1.5f, 0), 0.025f), 0.35f); var debris2 = new OrbitingPlanetObject(new Orbit(star, new Vector3(-1.5f, 2.5f, 0.3f), 0.015f), 0.25f); var debris3 = new OrbitingPlanetObject(new Orbit(star, new Vector3(1.5f, -2.5f, 0), 0.025f), 0.45f); var debris4 = new OrbitingPlanetObject(new Orbit(star, new Vector3(-1.5f, 1.2f, 1.5f), 0.025f), 0.25f); var debris5 = new OrbitingPlanetObject(new Orbit(star, new Vector3(1.5f, -3.5f, 0.3f), 0.035f), 0.35f); spaceModel.AddSpaceObject(debris1); spaceModel.AddSpaceObject(debris2); spaceModel.AddSpaceObject(debris3); spaceModel.AddSpaceObject(debris4); spaceModel.AddSpaceObject(debris5); var moon1 = new OrbitingSpaceObject(new Orbit(star, Vector3.Forward, 0.0009f, 0.0f, 7), 1f); var moon2 = new OrbitingSpaceObject(new Orbit(star, Vector3.Forward, 0.0009f, 1.25f, 7), 1f); var moon3 = new OrbitingSpaceObject(new Orbit(star, Vector3.Forward, 0.0009f, 2.5f, 7), 1f); var moon4 = new OrbitingSpaceObject(new Orbit(star, Vector3.Forward, 0.0009f, 3.75f, 7), 1f); var moon5 = new OrbitingSpaceObject(new Orbit(star, Vector3.Forward, 0.0009f, 5.0f, 7), 1f); spaceModel.AddSpaceObject(star); spaceModel.AddSpaceObject(moon1); spaceModel.AddSpaceObject(moon2); spaceModel.AddSpaceObject(moon3); spaceModel.AddSpaceObject(moon4); spaceModel.AddSpaceObject(moon5); return spaceModel; }
private SpaceModel<SpaceObject> MakeNebula() { var spaceModel = new SpaceModel<SpaceObject>(); spaceModel.AddSpaceObject(MakeNebula(Vector3.Up * 2, 80, 3, 10, 0.095f)); spaceModel.AddSpaceObject(MakeNebula(Vector3.Left * 3 + Vector3.Forward * 6, 90, 3, 10, 0.085f)); spaceModel.AddSpaceObject(MakeNebula(Vector3.Up * 5 + Vector3.Forward * 2, 80, 3, 10, 0.055f)); spaceModel.AddSpaceObject(MakeNebula(Vector3.Left * -6 + Vector3.Forward * 4, 80, 3, 10, 0.085f)); spaceModel.AddSpaceObject(MakeNebula(Vector3.Up * -4, 70, 3, 10, 0.055f)); return spaceModel; }
protected BaseStage(SpaceModel<SpaceObject> spaceModel) { SpaceModel = spaceModel; }
private SpaceModel<SpaceObject> MakeEncyclopediaGalaxy() { var spaceModel = new SpaceModel<SpaceObject>(); var galaxy = MakeGalaxy(Vector3.Zero, 20000, 1000, 1f, 0.065f); galaxy.Rotation = new Vector3(0,0.25f, 0); spaceModel.AddSpaceObject(galaxy); return spaceModel; }
public BlackScreen(SpaceModel<SpaceObject> spaceModel) : base(spaceModel) { }
public EmptySolarSystem(SpaceModel<SpaceObject> spaceModel) : base(spaceModel) { }
public EncyclopediaMenuCelestialsStage(SpaceModel<SpaceObject> spaceModel) : base(spaceModel) { _spaceModel = spaceModel; }
private SpaceModel<SpaceObject> MakeDiscSolarSystem() { var spaceModel = new SpaceModel<SpaceObject>(); var star = new StarObject(new Vector3(0, 0, 0), 10); spaceModel.AddSpaceObject(star); for (int i = 0; i < 12; i++) { spaceModel.AddSpaceObject(new OrbitingPlanetObject(NextStableOrbit(star, i), 1 + (float)rand.NextDouble())); } return spaceModel; }
public AboutExternalMenuStage(SpaceModel<SpaceObject> spaceModel) : base(spaceModel) { }
public AboutMenuStage(SpaceModel<SpaceObject> spaceModel) : base(spaceModel) { _spaceModel = spaceModel; }
public EncyclopediaScaleOfUniverse(SpaceModel<SpaceObject> spaceModel) : base(spaceModel) { }
private SpaceModel<SpaceObject> MakeEncyclopediaSolarSystem() { var spaceModel = new SpaceModel<SpaceObject>(); var star = new StarObject(new Vector3(0, 0, 0), 1); spaceModel.AddSpaceObject(star); var mainPlanet1 = new OrbitingPlanetObject(new Orbit(star, new Vector3(4, 4, 4), 0.01f), 0.3f); var mainPlanet2 = new OrbitingPlanetObject(new Orbit(star, new Vector3(3, -4, 1), 0.01f), 0.4f); var mainPlanet3 = new OrbitingPlanetObject(new Orbit(star, new Vector3(3, 2, -2), 0.01f), 0.5f); var mainPlanet4 = new OrbitingPlanetObject(new Orbit(star, new Vector3(-1, -1, 1), 0.03f), 0.2f); spaceModel.AddSpaceObject(mainPlanet1); spaceModel.AddSpaceObject(mainPlanet2); spaceModel.AddSpaceObject(mainPlanet3); spaceModel.AddSpaceObject(mainPlanet4); var moon1 = new OrbitingPlanetObject(new Orbit(mainPlanet3, new Vector3(0.4f, 0.4f, 0.4f), 0.1f), 0.035f); var moon2 = new OrbitingPlanetObject(new Orbit(mainPlanet3, new Vector3(-0.3f, -0.8f, -0.1f), 0.1f), 0.045f); var moon3 = new OrbitingPlanetObject(new Orbit(mainPlanet3, new Vector3(-0.5f, -0.2f, 0.3f), 0.1f), 0.02f); var moon4 = new OrbitingPlanetObject(new Orbit(mainPlanet3, new Vector3(0.3f, 0.8f, 0.1f), 0.1f), 0.045f); var moon5 = new OrbitingPlanetObject(new Orbit(mainPlanet1, new Vector3(-0.5f, -0.1f, 0.3f), 0.1f), 0.02f); var moon6 = new OrbitingPlanetObject(new Orbit(mainPlanet1, new Vector3(0.3f, 0.2f, -0.2f), 0.1f), 0.055f); spaceModel.AddSpaceObject(moon1); spaceModel.AddSpaceObject(moon2); spaceModel.AddSpaceObject(moon3); spaceModel.AddSpaceObject(moon4); spaceModel.AddSpaceObject(moon5); spaceModel.AddSpaceObject(moon6); return spaceModel; }
private SpaceModel<SpaceObject> MakeSunset() { var spaceModel = new SpaceModel<SpaceObject>(); var planet = new StaticHiResObject(Vector3.Left * 9 + Vector3.Down * 4, "Planets/EarthNight", 8.0f, 0.0003f, Vector3.Up); var star = new StarObject(Vector3.Forward * 20 + Vector3.Right * -5.5f + Vector3.Up * 3, 2, 0.001f, 0.9f,0.92f, 0.2f); spaceModel.AddSpaceObject(planet); spaceModel.AddSpaceObject(star); return spaceModel; }
private SpaceModel<SpaceObject> MakeEncyclopediaPlanet() { var spaceModel = new SpaceModel<SpaceObject>(); var planet = new StaticPlanetObject(Vector3.Zero, 5f); var moon1 = new OrbitingPlanetObject(new Orbit(planet, new Vector3(4, 4, 4), 0.01f), 0.35f); var moon2 = new OrbitingPlanetObject(new Orbit(planet, new Vector3(-3, -8, -1), 0.02f), 0.45f); var moon3 = new OrbitingPlanetObject(new Orbit(planet, new Vector3(-5, -2, 3), 0.01f), 0.2f); var moon4 = new OrbitingPlanetObject(new Orbit(planet, new Vector3(3, 8, 1), 0.03f), 0.45f); spaceModel.AddSpaceObject(planet); spaceModel.AddSpaceObject(moon1); spaceModel.AddSpaceObject(moon2); spaceModel.AddSpaceObject(moon3); spaceModel.AddSpaceObject(moon4); return spaceModel; }
private SpaceModel<SpaceObject> MakeStar() { var spaceModel = new SpaceModel<SpaceObject>(); var star = new StarObject(new Vector3(0, 0, 0), 5); spaceModel.AddSpaceObject(star); return spaceModel; }
public Session1Frame6(SpaceModel<SpaceObject> spaceModel) : base(spaceModel) { }
private SpaceModel<SpaceObject> MakeShootingOutPlanet() { var spaceModel = new SpaceModel<SpaceObject>(); var star = new StarObject(Vector3.Zero, 10, 0.001f); var planet = new OrbitingPlanetObject(new Orbit(star,Vector3.Up, 0.01f, 0,40, new Vector3(1,1,20)), 3); spaceModel.AddSpaceObject(planet); spaceModel.AddSpaceObject(star); return spaceModel; }
public EncyclopediaMenuScientistsStage(SpaceModel<SpaceObject> spaceModel) : base(spaceModel) { _spaceModel = spaceModel; }
public SessionMenuStage(SpaceModel<SpaceObject> spaceModel) : base(spaceModel) { _spaceModel = spaceModel; }
public IntroMenuStage(SpaceModel<SpaceObject> spaceModel) : base(spaceModel) { }
public BaseSessionFrame(SpaceModel<SpaceObject> spaceModel) : base(spaceModel) { ResetFrame(); }