Inheritance: MonoBehaviour
コード例 #1
0
        protected static Matrix computeCenterTransform(Globe globe, Position center)
        {
            if (globe == null)
            {
                var message = Logging.getMessage("nullValue.GlobeIsNull");
                Logging.logger().severe(message);
                throw new ArgumentException(message);
            }
            if (center == null)
            {
                var message = Logging.getMessage("nullValue.CenterIsNull");
                Logging.logger().severe(message);
                throw new ArgumentException(message);
            }

            // The view eye position will be the same as the center position.
            // This is only the case without any zoom, heading, and pitch.
            var eyePoint = globe.computePointFromPosition(center);
            // The view forward direction will be colinear with the
            // geoid surface normal at the center position.
            var normal      = globe.computeSurfaceNormalAtLocation(center.getLatitude(), center.getLongitude());
            var lookAtPoint = eyePoint.subtract3(normal);
            // The up direction will be pointing towards the north pole.
            var north = globe.computeNorthPointingTangentAtLocation(center.getLatitude(), center.getLongitude());

            // Creates a viewing matrix looking from eyePoint towards lookAtPoint,
            // with the given up direction. The forward, right, and up vectors
            // contained in the matrix are guaranteed to be orthogonal. This means
            // that the Matrix's up may not be equivalent to the specified up vector
            // here (though it will point in the same general direction).
            // In this case, the forward direction would not be affected.
            return(Matrix.fromViewLookAt(eyePoint, lookAtPoint, north));
        }
コード例 #2
0
        private void ReadConfig()
        {
            Globe.ConfigDic.Clear();

            try
            {
                StreamReader configReader = new StreamReader(Globe.ConfigFile, Encoding.Default);

                string line = string.Empty;

                while (line != null)
                {
                    line = configReader.ReadLine();

                    if (line != null && !line.Equals(string.Empty) && !line.StartsWith("//"))
                    {
                        string[] temp = line.Split('=');
                        Globe.ConfigDic.Add(temp[0].Trim(), temp[1].Trim());
                    }
                }

                configReader.Close();
            }
            catch (Exception ex)
            {
                Globe.WriteLog("Configuration.ReadConfig: " + ex.Message);
            }
        }
コード例 #3
0
ファイル: UILevel.cs プロジェクト: moto2002/moba
    void OpenScene()
    {
        SceneNode scene = FSDataNodeTable <SceneNode> .GetSingleton().FindDataByType(mapid != 0 ? mapid : 102);

        if (null == scene)
        {
            Debug.Log("No configuration is read : " + mapid);
            return;
        }
        Control.HideGUI(UIPanleID.UIMoney);
        TfMapContainer.gameObject.SetActive(true);

        TfWorldMap.GetComponent <UIWorldMap>().OnMapBtnClick(scene.bigmap_id);
        if (scene.Type == 2 && TfMapContainer.GetComponent <UIMapContainer>().isOpenElite)
        {
            TfMapContainer.GetComponent <UIMapContainer>().ChangeDifficultyToElite();
        }

        Dictionary <int, int[]> mapInfo = new Dictionary <int, int[]>();

        if (!GameLibrary.mapOrdinary.TryGetValue(scene.bigmap_id, out mapInfo))
        {
            return;
        }

        if (mapInfo.ContainsKey(mapid) && mapid != 0)
        {
            if (Globe.GetStar(mapInfo[mapid]) >= 0)
            {
                TfMapContainer.GetComponent <UIMapContainer>().ShowSceneEntry(scene);
            }
        }
    }
コード例 #4
0
        public void Use(Agent agent, Globe globe, IDice dice)
        {
            var highestBranchs = agent.Skills.OrderBy(x => x.Value)
                                 .Where(x => x.Value >= 1);

            var agentNameGenerator = globe.agentNameGenerator;

            if (highestBranchs.Any())
            {
                var firstBranch = highestBranchs.First();

                var agentDisciple = new Agent
                {
                    Name     = agentNameGenerator.Generate(Sex.Male, 1),
                    Location = agent.Location,
                    Realm    = agent.Realm,
                    Hp       = 3
                };

                agentDisciple.Skills.Add(firstBranch.Key, firstBranch.Value / 2);

                globe.Agents.Add(agent);

                CacheHelper.AddAgentToCell(globe.AgentCells, agentDisciple.Location, agent);
            }
            else
            {
                globe.AgentCrisys++;
            }
        }
コード例 #5
0
    void GlobeGenerate(int x, int y)
    {
        GlobeColor color = (GlobeColor)Random.Range(0, 4);
        int        value = Random.Range(1, 10);

        globeArray[x, y] = new Globe(generator.GlobeGenerate(color, value, x, y), color, value);
    }
コード例 #6
0
        public static ViewState computeViewState(Globe globe, Vec4 eyePoint, Vec4 centerPoint, Vec4 up)
        {
            if (globe == null)
            {
                String message = Logging.getMessage("nullValue.GlobeIsNull");
                Logging.logger().severe(message);
                throw new ArgumentException(message);
            }
            if (eyePoint == null)
            {
                String message = "nullValue.EyePointIsNull";
                Logging.logger().severe(message);
                throw new ArgumentException(message);
            }
            if (centerPoint == null)
            {
                String message = "nullValue.CenterPointIsNull";
                Logging.logger().severe(message);
                throw new ArgumentException(message);
            }
            if (up == null)
            {
                up = ViewUtil.getUpVector(globe, centerPoint);
            }

            Matrix modelview = Matrix.fromViewLookAt(eyePoint, centerPoint, up);

            return(ViewUtil.computeModelCoordinates(globe, modelview, centerPoint,
                                                    eyePoint));
        }
コード例 #7
0
        public Globe MoveGlobe(Globe globe)
        {
            globe.X += globe.SpeedX;
            globe.Y += globe.SpeedY;

            return(globe);
        }
コード例 #8
0
        public static Matrix computeTransformMatrix(Globe globe, Position position, Angle heading, Angle pitch, Angle roll)
        {
            if (heading == null)
            {
                String message = Logging.getMessage("nullValue.HeadingIsNull");
                Logging.logger().severe(message);
                throw new ArgumentException(message);
            }
            if (pitch == null)
            {
                String message = Logging.getMessage("nullValue.PitchIsNull");
                Logging.logger().severe(message);
                throw new ArgumentException(message);
            }

            // To get a yaw-pitch-roll transform, do the view transform in reverse (i.e. roll-pitch-yaw)
            Matrix transform = Matrix.IDENTITY;

            transform = transform.multiply(Matrix.fromAxisAngle(roll, 0, 0, 1));
            transform = transform.multiply(Matrix.fromAxisAngle(pitch, -1, 0, 0));
            transform = transform.multiply(Matrix.fromAxisAngle(heading, 0, 0, 1));

            transform = transform.multiply(computePositionTransform(globe, position));

            return(transform);
        }
コード例 #9
0
        public static Matrix computeModelViewMatrix(Globe globe, Vec4 eyePoint, Vec4 centerPoint, Vec4 up)
        {
            if (globe == null)
            {
                String message = Logging.getMessage("nullValue.GlobeIsNull");
                Logging.logger().severe(message);
                throw new ArgumentException(message);
            }
            if (eyePoint == null)
            {
                String message = "nullValue.EyePointIsNull";
                Logging.logger().severe(message);
                throw new ArgumentException(message);
            }
            if (centerPoint == null)
            {
                String message = "nullValue.CenterPointIsNull";
                Logging.logger().severe(message);
                throw new ArgumentException(message);
            }
            if (up == null)
            {
                String message = "nullValue.UpIsNull";
                Logging.logger().severe(message);
                throw new ArgumentException(message);
            }

            Matrix modelview = Matrix.fromViewLookAt(eyePoint, centerPoint, up);

            return(modelview);
        }
コード例 #10
0
    public HeroData DefaultMainHeroData()
    {
        HeroData hd = null;

        if (Globe.playHeroList[0] == null || Globe.playHeroList[0].id == 0)
        {
            if (!GameLibrary.isNetworkVersion)
            {
                Globe.fightHero[0] = (int)GameLibrary.player;
            }
            else
            {
                GameLibrary.player = Globe.fightHero[0];
            }
            playerData.GetInstance().AddHeroToList(Globe.fightHero[0]);
        }
        if (mCurActiveSceneName == GameLibrary.UI_Major || mCurActiveSceneName == GameLibrary.LGhuangyuan)
        {
            hd = Globe.playHeroList[0];
        }
        else
        {
            hd = Globe.Heros()[0];
            if (null == hd)
            {
                hd = new HeroData(GameLibrary.player);
            }
        }
        hd.state      = Modestatus.Player;
        hd.groupIndex = 1;
        return(hd);
    }
コード例 #11
0
 private static async System.Threading.Tasks.Task <GlobeRegion> CreateRegionAsync(Globe globe,
                                                                                  TerrainCell startCell,
                                                                                  IWorldGenerator globeGenerator,
                                                                                  ProgressStorageService progressStorageService)
 {
     return(await globeGenerator.GenerateRegionAsync(globe, startCell));
 }
コード例 #12
0
        /**
         * Computes an extent bounding the the specified sectors on the specified Globe's surface. If the list contains a
         * single sector this returns a box created by calling {@link SharpEarth.geom.Sector#computeBoundingBox(gov.nasa.worldwind.globes.Globe,
         * double, SharpEarth.geom.Sector)}. If the list contains more than one sector this returns a {@link
         * SharpEarth.geom.Box} containing the corners of the boxes bounding each sector. This returns null if the
         * sector list is empty.
         *
         * @param globe                the globe the extent relates to.
         * @param verticalExaggeration the globe's vertical surface exaggeration.
         * @param sectors              the sectors to bound.
         *
         * @return an extent for the specified sectors on the specified Globe.
         */
        protected Extent computeExtent(Globe globe, double verticalExaggeration, List <Sector> sectors)
        {
            // This should never happen, but we check anyway.
            if (sectors.size() == 0)
            {
                return(null);
            }
            // This surface shape does not cross the international dateline, and therefore has a single bounding sector.
            // Return the box which contains that sector.
            else if (sectors.size() == 1)
            {
                return(Sector.computeBoundingBox(globe, verticalExaggeration, sectors.get(0)));
            }
            // This surface crosses the international dateline, and its bounding sectors are split along the dateline.
            // Return a box which contains the corners of the boxes bounding each sector.
            else
            {
                ArrayList <Vec4> boxCorners = new ArrayList <Vec4>();

                foreach (Sector s in sectors)
                {
                    Box box = Sector.computeBoundingBox(globe, verticalExaggeration, s);
                    boxCorners.addAll(Arrays.asList(box.getCorners()));
                }

                return(Box.computeBoundingBox(boxCorners));
            }
        }
コード例 #13
0
 public static OrbitViewState getSurfaceIntersection(Globe globe, SectorGeometryList terrain, Position centerPosition,
                                                     Angle heading, Angle pitch, double zoom)
 {
     if (globe != null)
     {
         var modelview = computeTransformMatrix(globe, centerPosition,
                                                heading, pitch, Angle.ZERO, zoom);
         if (modelview != null)
         {
             var modelviewInv = modelview.getInverse();
             if (modelviewInv != null)
             {
                 var eyePoint      = Vec4.UNIT_W.transformBy4(modelviewInv);
                 var centerPoint   = globe.computePointFromPosition(centerPosition);
                 var eyeToCenter   = eyePoint.subtract3(centerPoint);
                 var intersections = terrain.intersect(new Line(eyePoint, eyeToCenter.normalize3().multiply3(-1)));
                 if (intersections != null && intersections.Length >= 0)
                 {
                     var newCenter = globe.computePositionFromPoint(intersections[0].getIntersectionPoint());
                     return(new OrbitViewState(newCenter, heading, pitch, zoom));
                 }
             }
         }
     }
     return(null);
 }
コード例 #14
0
        public static OrbitViewState computeOrbitViewState(Globe globe, Vec4 eyePoint, Vec4 centerPoint, Vec4 up)
        {
            if (globe == null)
            {
                var message = Logging.getMessage("nullValue.GlobeIsNull");
                Logging.logger().severe(message);
                throw new ArgumentException(message);
            }
            if (eyePoint == null)
            {
                var message = "nullValue.EyePointIsNull";
                Logging.logger().severe(message);
                throw new ArgumentException(message);
            }
            if (centerPoint == null)
            {
                var message = "nullValue.CenterPointIsNull";
                Logging.logger().severe(message);
                throw new ArgumentException(message);
            }
            if (up == null)
            {
                var message = "nullValue.UpIsNull";
                Logging.logger().severe(message);
                throw new ArgumentException(message);
            }

            var modelview = Matrix.fromViewLookAt(eyePoint, centerPoint, up);

            return(computeOrbitViewState(globe, modelview, centerPoint));
        }
コード例 #15
0
ファイル: Globe_S.cs プロジェクト: qaz734913414/TLC
        public static string GetBase_Str(string globes, List <Globe> Globe_List)
        {
            string content = string.Empty;

            try
            {
                if (!string.IsNullOrEmpty(globes))
                {
                    string[] globeArray = globes.Split(new char[] { ',' });

                    for (int i = 0; i < globeArray.Length; i++)
                    {
                        int   clue  = Convert.ToInt32(globeArray[i]);
                        Globe globe = Globe_List.FirstOrDefault(g => g.Code == clue);
                        content += globe.Name + ",";
                    }
                }
            }
            catch (Exception ex)
            {
                LogHelper.Error(ex);
            }

            return(content);
        }
コード例 #16
0
 void OnTriggerEnter(Collider coll)
 {
     if (coll.tag == "Player")
     {
         Globe.SaveData();
     }
 }
コード例 #17
0
 //-/////////////////////////////////////////////////////////////////////
 public void GetPanes()
 {
     Console.Clear();
     DockWindow[] winds = new DockWindow[] {
         Globe.App.DockBase.DockWindows[DockState.DockTop],
         Globe.App.DockBase.DockWindows[DockState.DockBottom],
         Globe.App.DockBase.DockWindows[DockState.DockLeft],
         Globe.App.DockBase.DockWindows[DockState.DockRight],
         //					Globe.App.DockBase.DockWindows[DockState.DockTopAutoHide],
         //					Globe.App.DockBase.DockWindows[DockState.DockBottomAutoHide],
         //					Globe.App.DockBase.DockWindows[DockState.DockLeftAutoHide],
         //					Globe.App.DockBase.DockWindows[DockState.DockRightAutoHide],
         Globe.App.DockBase.DockWindows[DockState.Document],
         //					Globe.App.DockBase.DockWindows[DockState.Hidden],
         //					Globe.App.DockBase.DockWindows[DockState.Unknown],
     };
     foreach (DockWindow wind in winds)
     {
         Globe.cstat(ConsoleColor.Red, "{0}", wind);
     }
     Globe.cstat(ConsoleColor.Red, "begin:{0}", new object[] { "init" });
     foreach (DockPane dp in Globe.App.DockBase.Panes)
     {
         GetDocks(dp);
     }
     Globe.cstat(ConsoleColor.Red, "end:{0}", new object[] { "init2" });
 }
コード例 #18
0
ファイル: Globe_S.cs プロジェクト: qaz734913414/TLC
        public static List <Globe_S> GetBase(string globes, List <Globe> Globe_List)
        {
            List <Globe_S> list = new List <Globe_S>();

            try
            {
                if (!string.IsNullOrEmpty(globes))
                {
                    string[] globeArray = globes.Split(new char[] { ',' });

                    for (int i = 0; i < globeArray.Length; i++)
                    {
                        int   clue  = Convert.ToInt32(globeArray[i]);
                        Globe globe = Globe_List.FirstOrDefault(g => g.Code == clue);
                        list.Add(Globe_S.GetBase(globe));
                    }
                }
            }
            catch (Exception ex)
            {
                LogHelper.Error(ex);
            }

            return(list);
        }
コード例 #19
0
        public void Use(Agent agent, Globe globe, IDice dice)
        {
            var highestBranchs = agent.Skills.OrderBy(x => x.Value)
                                 .Where(x => x.Value >= 1);

            if (highestBranchs.Any())
            {
                var firstBranch = highestBranchs.First();

                var agentDisciple = new Agent
                {
                    Name      = agent.Name + " disciple",
                    Localtion = agent.Localtion,
                    Realm     = agent.Realm,
                    Hp        = 3
                };

                globe.Agents.Add(agent);

                Helper.AddAgentToCell(globe.AgentCells, agentDisciple.Localtion, agent);
            }
            else
            {
                globe.AgentCrisys++;
            }
        }
コード例 #20
0
    void ShowHeroInfo()
    {
        if (null == Globe.Heros())
        {
            return;
        }
        GameObject go       = null;
        HeroData   heroData = null;

        for (int i = 0; i < 4; i++)
        {
            if (null == Globe.Heros()[i] || Globe.Heros()[i].id == 0)
            {
                continue;
            }
            go = NGUITools.AddChild(HeroGrid.gameObject, HeroGo);
            if (Globe.Heros()[i] != null && Globe.Heros()[i].id != 0)
            {
                heroData = playerData.GetInstance().GetHeroDataByID(Globe.Heros()[i].id);
                if (null == heroData)
                {
                    continue;
                }
                heroData.exps += sceneNode.exp;
                UpGradeHero(heroData);
                go.GetComponent <AccountItem>().RefreshUIHero(Globe.Heros()[i].id, sceneNode.exp);
            }
        }
        HeroGrid.Reposition();
    }
コード例 #21
0
        private async void button1_Click(object sender, EventArgs e)
        {
            try
            {
                var config = new Configuration();
                config.GetConfiguration();

                var directory = new DirectoryInfo(Globe.RootDir + "ligler\\");
                var leagueDir = directory.GetDirectories();

                foreach (DirectoryInfo league in leagueDir)
                {
                    var updateDB = new UpdateDataBase(league.Name, league.FullName);
                    await Task.Factory.StartNew(() =>
                    {
                        updateDB.LoadFolder();
                        updateDB.LoadFolder2();
                    });
                }
            }
            catch (Exception ex)
            {
                Globe.WriteLog("Veritabanına yazamadım : " + ex.Message);
            }
        }
コード例 #22
0
        public bool CanUse(Agent agent, Globe globe)
        {
            var highestBranchs = agent.Skills.OrderBy(x => x.Value)
                                 .Where(x => x.Value >= 1);

            return(highestBranchs.Any() && agent.Hp < 1);
        }
コード例 #23
0
        private void btnTurkiyeLigi_Click(object sender, EventArgs e)
        {
            var config = new Configuration();

            config.GetTurkConfiguration();

            try
            {
                var spider = new SpiderAsync();
                spider.GetAllLeagues();
            }
            catch (Exception ex)
            {
                Globe.WriteLog("Lig klasörlerini oluştururken bir sorun oluştu : " + ex.Message);
            }

            try
            {
                var spider = new SpiderAsync();
                spider.GetAllMatches(MaclarWriter, MacWriter);
            }
            catch (Exception ex)
            {
                Globe.WriteLog("Maç dosyalarını oluştururken bir sorun oluştu : " + ex.Message);
            }
        }
コード例 #24
0
        private async void btnMacBilgileri_Click(object sender, EventArgs e)
        {
            try
            {
                CheckForIllegalCrossThreadCalls = false;
                var config = new Configuration();
                config.GetConfiguration();
                lstMacBilgileri.Items.Clear();

                var directory = new DirectoryInfo(Globe.RootDir + "ligler\\");
                var leagueDir = directory.GetDirectories();

                foreach (DirectoryInfo league in leagueDir)
                {
                    await Task.Factory.StartNew(() =>
                    {
                        var updateDB = new UpdateDataBase(league.Name, league.FullName);
                        updateDB.LoadFolder(VeriTabaniWriter);
                        lstMacBilgileri.SelectedIndex = lstMacBilgileri.Items.Count - 1;
                    });
                }
            }
            catch (Exception ex)
            {
                Globe.WriteLog("Veritabanına yazamadım : " + ex.Message);
            }
        }
コード例 #25
0
ファイル: Globe_ClueBase.cs プロジェクト: qaz734913414/TLC
        /// <summary>
        /// 设置生肖
        /// </summary>
        public void Set_Animal(Globe_Clue item, List <Animal_Info> Animal_Info_List, List <Globe> GlobeList)
        {
            try
            {
                string[] globe_clues = item.Clue.Split(new char[] { ',' });
                string[] globe_pays  = item.Pay.Split(new char[] { ',' });
                for (int i = 0; i < globe_clues.Length; i++)
                {
                    int         clue        = Convert.ToInt32(globe_clues[i]);
                    Animal_Info animal_Info = Animal_Info_List.FirstOrDefault(g => g.Code == clue);
                    if (animal_Info != null)
                    {
                        float         pay          = float.Parse(globe_pays[i]);
                        Animal_Info_S Animal_InfoS = Animal_Info_S.GetBase(animal_Info, pay);

                        List <Globe_S> templist = new List <Globe_S>();
                        foreach (var code in Animal_InfoS.GlobeCodeList)
                        {
                            Globe globle = GlobeList.FirstOrDefault(c => c.Code == code);
                            if (globle != null)
                            {
                                Globe_S globle_s = Globe_S.GetBase(globle);
                                templist.Add(globle_s);
                            }
                        }
                        Animal_InfoS.GlobeList = templist.ToArray();
                        this.Animal_List.Add(Animal_InfoS);
                    }
                }
            }
            catch (Exception ex)
            {
                LogHelper.Error(ex);
            }
        }
コード例 #26
0
 public override void Draw(Batch Batch, Vector2 Position, Color Color, float Opacity, float Angle, Origin Origin,
                           float Scale, SpriteEffects Effect = SpriteEffects.None, float Layer = 0)
 {
     /*Batch.Draw(Textures.Get("Players.1-" + Mod.Weapons[Weapon].Texture), Position, null, (Color.Black * (Opacity * .65f)), Angle, new Origin(Mod.Weapons[Weapon].Player.X, Mod.Weapons[Weapon].Player.Y),
      *  Scale, SpriteEffects.None, .425002f);*/
     if (!Dead)
     {
         if (Vector2.Distance(InterpolatedPosition, Position) <= 50)
         {
             Vector2 ShadowPosition = Globe.Move(InterpolatedPosition, Globe.Angle(new Vector2((Map.Width / 2f), (Map.Height / 2f)), InterpolatedPosition),
                                                 (4 + (Vector2.Distance(new Vector2((Map.Width / 2f), (Map.Height / 2f)), InterpolatedPosition) / 250)));
             Batch.Draw(Textures.Get("Players.1-" + Mod.Weapons[Weapon].Texture), ShadowPosition, null, (Color.Black * (Opacity * .35f)), InterpolatedAngle, new Origin(Mod.Weapons[Weapon].Player.X, Mod.Weapons[Weapon].Player.Y),
                        Scale, SpriteEffects.None, .425001f);
             Batch.Draw(Textures.Get("Players.1-" + Mod.Weapons[Weapon].Texture), InterpolatedPosition, null, (Color * Opacity), InterpolatedAngle, new Origin(Mod.Weapons[Weapon].Player.X, Mod.Weapons[Weapon].Player.Y),
                        Scale, SpriteEffects.None, .425f);
         }
         else
         {
             Vector2 ShadowPosition = Globe.Move(Position, Globe.Angle(new Vector2((Map.Width / 2f), (Map.Height / 2f)), Position),
                                                 (4 + (Vector2.Distance(new Vector2((Map.Width / 2f), (Map.Height / 2f)), Position) / 250)));
             Batch.Draw(Textures.Get("Players.1-" + Mod.Weapons[Weapon].Texture), ShadowPosition, null, (Color.Black * (Opacity * .35f)), Angle, new Origin(Mod.Weapons[Weapon].Player.X, Mod.Weapons[Weapon].Player.Y),
                        Scale, SpriteEffects.None, .425001f);
             Batch.Draw(Textures.Get("Players.1-" + Mod.Weapons[Weapon].Texture), Position, null, (Color.Black * (Opacity * .65f)), Angle, new Origin(Mod.Weapons[Weapon].Player.X, Mod.Weapons[Weapon].Player.Y),
                        Scale, SpriteEffects.None, .425001f);
         }
     }
     //Mask.Draw(Color.White, 1);
 }
コード例 #27
0
ファイル: Globe_ClueBase.cs プロジェクト: qaz734913414/TLC
        /// <summary>
        /// 设置半波
        /// </summary>
        public void Set_Wave(Globe_Clue item, List <Wave> Wave_List, List <Globe> GlobeList)
        {
            try
            {
                string[] globe_clues = item.Clue.Split(new char[] { ',' });
                string[] globe_pays  = item.Pay.Split(new char[] { ',' });
                for (int i = 0; i < globe_clues.Length; i++)
                {
                    int  clue = Convert.ToInt32(globe_clues[i]);
                    Wave wave = Wave_List.FirstOrDefault(g => g.Code == clue);
                    if (wave != null)
                    {
                        float  pay    = float.Parse(globe_pays[i]);
                        Wave_S Wave_S = Wave_S.GetBase(wave, pay);

                        List <Globe_S> templist = new List <Globe_S>();
                        foreach (var code in Wave_S.GlobeCodeList)
                        {
                            Globe globle = GlobeList.FirstOrDefault(c => c.Code == code);
                            if (globle != null)
                            {
                                Globe_S globle_s = Globe_S.GetBase(globle);
                                templist.Add(globle_s);
                            }
                        }
                        Wave_S.GlobeList = templist.ToArray();
                        this.Wave_List.Add(Wave_S);
                    }
                }
            }
            catch (Exception ex)
            {
                LogHelper.Error(ex);
            }
        }
コード例 #28
0
 public void Use(Agent agent, Globe globe, IDice dice)
 {
     if (globe.LocalitiesCells.TryGetValue(agent.Location, out var currentLocality))
     {
         currentLocality.Population++;
     }
 }
コード例 #29
0
 public StateKey(EllipsoidalGlobe ellipsoidalGlobe)
 {
     this.globe                = ellipsoidalGlobe;
     this._tessellator         = ellipsoidalGlobe._tessellator;
     this.verticalExaggeration = 1;
     this.elevationModel       = this.globe.getElevationModel();
 }
コード例 #30
0
ファイル: Game.cs プロジェクト: DeanReynolds/Orbis
 public static void UpdateMenuWorld(GameTime time)
 {
     if (!CamWaypoint.HasValue)
     {
         var nextSurface = new Point((((int)(MenuWorld.X / Tile.Size)) + ((CamNorm > 0) ? 1 : -1)), (int)(MenuWorld.Y / Tile.Size));
         for (var y = 1; y < MenuWorld.Height - 1; y++)
         {
             if (MenuWorld.Tiles[nextSurface.X, y].Solid)
             {
                 nextSurface.Y = (y - 1);
                 break;
             }
         }
         var tileHalved = (Tile.Size / 2f);
         CamWaypoint = (new Vector2(((nextSurface.X * Tile.Size) + tileHalved), ((nextSurface.Y * Tile.Size) + tileHalved)));
     }
     else
     {
         Globe.Move(ref CamPos, CamWaypoint.Value, (Math.Abs(CamNorm * 32) * (float)(time.ElapsedGameTime.TotalSeconds * 4)));
         const float camNormVel = .8f;
         MenuWorld.Position = new Vector2((int)Math.Round(CamPos.X), (int)Math.Round(CamPos.Y));
         if (Vector2.Distance(CamPos, CamWaypoint.Value) <= 4)
         {
             CamWaypoint = null;
         }
         if (CamPos.X >= (((MenuWorld.Width * Tile.Size) - (Screen.BackBufferWidth / 2f)) - (Tile.Size * 8)))
         {
             CamNorm = MathHelper.Max(-1, (CamNorm - (camNormVel * (float)time.ElapsedGameTime.TotalSeconds)));
         }
         else if (CamPos.X <= ((Screen.BackBufferWidth / 2f) + (Tile.Size * 9)))
         {
             CamNorm = MathHelper.Min(1, (CamNorm + (camNormVel * (float)time.ElapsedGameTime.TotalSeconds)));
         }
     }
 }
コード例 #31
0
ファイル: Globe.cs プロジェクト: yupassion/Cinderella
 public static Globe GetInstance()
 {
     if (_instance == null)
     {
         _instance=new Globe();
     }
     return _instance;
 }