• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Environment类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Environment的典型用法代码示例。如果您正苦于以下问题:C# Environment类的具体用法?C# Environment怎么用?C# Environment使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Environment类属于命名空间,在下文中一共展示了Environment类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: StoreGet

 public StoreGet(Environment environment, Action<Event> callback)
     : base(environment)
 {
     CallbackList.Add(callback);
       Time = environment.Now;
       Process = environment.ActiveProcess;
 }
开发者ID:hsz-develop,项目名称:abeham--SimSharp,代码行数:7,代码来源:StoreGet.cs


示例2: Cond

        public static SExp Cond(SExp[] vals, Environment env)
        {
            SExp res = new Undefined();
              foreach (SExp exp in vals)
              {
            if (!(exp is Cell))
            {
              string msg = "cond: malformed clauses.";
              throw new TypeNotMatchException(msg);
            }

            SExp test = (exp as Cell).Car;

            if (!((exp as Cell).Cdr is Cell))
            {
              string msg = "cond: malformed clauses.";
              throw new TypeNotMatchException(msg);
            }

            SExp[] body = ((exp as Cell).Cdr as Cell).ToArray();

            if (Utilities.CanRegardAsTrue(Utilities.Eval(test, env)))
            {
              res = Utilities.Eval(body, env);
              break;

            }
              }
              return res;
        }
开发者ID:yagiey,项目名称:scallop,代码行数:30,代码来源:Syntaxes.cs


示例3: Environment_Constructor_Sets_Properties_Correctly

        public void Environment_Constructor_Sets_Properties_Correctly()
        {
            var environment = new Environment("en-gb")
            {
                CharacterSet = "iso-8550-1",
                FlashVersion = "11.0.1b",
                ScreenColorDepth = 32,
                IpAddress = "127.0.0.1",
                JavaEnabled = true,
                ScreenHeight = 1050,
                ScreenWidth = 1920,
                ViewportHeight = 768,
                ViewportWidth = 1024
            };

            Assert.AreEqual("iso-8550-1", environment.CharacterSet);
            Assert.AreEqual("en-gb", environment.LanguageCode);
            Assert.AreEqual("11.0.1b", environment.FlashVersion);
            Assert.AreEqual(32u, environment.ScreenColorDepth);
            Assert.AreEqual("127.0.0.1", environment.IpAddress);
            Assert.AreEqual(true, environment.JavaEnabled);
            Assert.AreEqual(1050u, environment.ScreenHeight);
            Assert.AreEqual(1920u, environment.ScreenWidth);
            Assert.AreEqual(768u, environment.ViewportHeight);
            Assert.AreEqual(1024u, environment.ViewportWidth);
        }
开发者ID:bayramucuncu,项目名称:CSharpAnalytics,代码行数:26,代码来源:EnvironmentTests.cs


示例4: PanningBackground

        public PanningBackground()
        {
            m_parallaxEnvironments = new LinkedList<ParallaxEnvironment>();
            m_random = new Random(DateTime.Now.Millisecond);
            float t_houseDistance = Game.getInstance().getResolution().X / 10;
            m_background = Game.getInstance().Content.Load<Texture2D>("Images//Background//starry_sky_01");

            for (int i = 0; i < 50; i++)
            {
                m_parallaxEnvironments.AddLast(new ParallaxEnvironment(
                    new Vector2(t_houseDistance * i - Game.getInstance().m_camera.getRectangle().Width, -300),
                    "Images//Background//Parallax//bg_house_0" + randomNumber(1, 7).ToString(),
                    0.950f
                ));
                m_parallaxEnvironments.Last().setParrScroll(randomNumber(50, 600));
            }
            for (int i = 0; i < 25; i++)
            {
                m_parallaxEnvironments.AddLast(new ParallaxEnvironment(
                    new Vector2(t_houseDistance * i - Game.getInstance().m_camera.getRectangle().Width, randomNumber(-300, 200)),
                    "Images//Background//Parallax//clouds_0" + randomNumber(1, 4).ToString(),
                    0.950f
                ));
                m_parallaxEnvironments.Last().setParrScroll(randomNumber(50, 600));
            }
            m_logo = new Environment(new Vector2(-400, -250), "Images//GUI//logotext", 0.800f);
        }
开发者ID:melburn,项目名称:GLhf,代码行数:27,代码来源:PanningBackground.cs


示例5: DeleteInfo

        void ICanModifyContext.PopulateContext(Environment env, string ns)
        {
            AST ast;
            for (int i = 0; i < elems.Count; i++) {
                ast = (AST) elems [i];
                if (ast is FunctionDeclaration) {
                    string name = ((FunctionDeclaration) ast).func_obj.name;
                    AST binding = (AST) env.Get (ns, Symbol.CreateSymbol (name));

                    if (binding == null)
                        SemanticAnalyser.Ocurrences.Enter (ns, Symbol.CreateSymbol (name), new DeleteInfo (i, this));
                    else {
                        DeleteInfo delete_info = (DeleteInfo) SemanticAnalyser.Ocurrences.Get (ns, Symbol.CreateSymbol (name));
                        if (delete_info != null) {
                            delete_info.Block.elems.RemoveAt (delete_info.Index);
                            SemanticAnalyser.Ocurrences.Remove (ns, Symbol.CreateSymbol (name));
                            if (delete_info.Block == this)
                                if (delete_info.Index < i)
                                    i--;

                            SemanticAnalyser.Ocurrences.Enter (ns, Symbol.CreateSymbol (name), new DeleteInfo (i, this));
                        }
                    }
                }
                if (ast is ICanModifyContext)
                    ((ICanModifyContext) ast).PopulateContext (env, ns);
            }
        }
开发者ID:mayatforest,项目名称:Refractor,代码行数:28,代码来源:Block.cs


示例6: BasicLoopWord

        public BasicLoopWord(string definingWordName, Environment env)
            : base(definingWordName, env)
        {
            CycleWord = new ControlFlowWord("cycle", env);

            PrimitiveExecuteAction = executeLoop;
        }
开发者ID:aistrate,项目名称:ForthInterpreter,代码行数:7,代码来源:BasicLoopWord.cs


示例7: EvaluateTimeBase

 /// <summary>
 /// Initializes a new instance of the EvaluateTimeBase class.
 /// </summary>
 /// <param name="expr">The expression to evaluate.</param>
 /// <param name="count">The number of times to evaluate.</param>
 /// <param name="env">The evaluation environment</param>
 /// <param name="caller">The caller.  Return to this when done.</param>
 protected EvaluateTimeBase(SchemeObject expr, int count, Environment env, Evaluator caller)
     : base(InitialStep, expr, env, caller)
 {
     this.counter = count;
     this.startMem = GC.GetTotalMemory(true);
     this.stopwatch = Stopwatch.StartNew();
 }
开发者ID:cchayden,项目名称:SimpleScheme,代码行数:14,代码来源:EvaluateTimeBase.cs


示例8: Instance

        // AudioContexts are per process and not per thread
        public static Environment Instance()
        {
            if (env == null)
                    env = new Environment();

                return env;
        }
开发者ID:CryoGenesis,项目名称:MAVG-Jeden-Public,代码行数:8,代码来源:Environment.cs


示例9: copy

        //Constructor that initializes variables with default values
        public Environment copy()
        {
            Environment newenv = new Environment();
              newenv.seed=seed;
              newenv.AOIRectangle = new Rectangle(AOIRectangle.X,AOIRectangle.Y,AOIRectangle.Width,AOIRectangle.Height);
              newenv.group_orientation = group_orientation;
              newenv.goal_point = new Point2D(goal_point);
              newenv.start_point = new Point2D(start_point);
              newenv.robot_heading = robot_heading;
              newenv.robot_spacing = robot_spacing;
              newenv.maxDistance=maxDistance;
              newenv.name=name;
              newenv.view_scale=view_scale;
              newenv.view_x=view_x;
              newenv.view_y=view_y;

            foreach (Wall w in walls) {
             newenv.walls.Add(new Wall(w));
            }
            foreach (Prey p in preys) {
              newenv.preys.Add(new Prey(p));
            }
            foreach (Point p in POIPosition) {
             newenv.POIPosition.Add(new Point(p.X,p.Y));
            }
              newenv.rng = new SharpNeatLib.Maths.FastRandom(seed);
             return newenv;
        }
开发者ID:jtglaze,项目名称:IndependentWork2013,代码行数:29,代码来源:Environment.cs


示例10: GrabComponent

 public GrabComponent(Entity parent, Environment environment, float baseDamage, float maxDamage)
     : base(parent, "GrabComponent")
 {
     this.environment = environment;
     this.baseDamage = baseDamage;
     this.maxDamage = maxDamage;
 }
开发者ID:regenvanwalbeek,项目名称:BattleFury,代码行数:7,代码来源:GrabComponent.cs


示例11: eval

 public override Node eval(Node t, Environment env)
 {
     Node clauseList = t.getCdr();
     Node clause = clauseList.getCar();
     while(clause != Nil.getInstance())
     {
         Node predicate = clause.getCar().eval(env);
         if(predicate == BoolLit.getInstance(true) || predicate.getName() == "else")
         {
             Node expressionList = clause.getCdr();
             //evaluate all expressions and return the result of the last evaluation
             Node lastEval = expressionList.getCar().eval(env);
             //If there are more expressions to evaluate
             while(expressionList.getCdr() != Nil.getInstance())
             {
                 expressionList = expressionList.getCdr();
                 lastEval = expressionList.getCar().eval(env);
             }
             return lastEval;
         }
         clauseList = clauseList.getCdr();
         clause = clauseList.getCar();
     }
     //Does not yet handle else's
     return Nil.getInstance();
 }
开发者ID:matthewjwolff,项目名称:Scheme4101,代码行数:26,代码来源:Cond.cs


示例12: play

 public void play(Environment e, UsefulMethods odd, Player player)
 {
     Random rand = new Random();
     int randNum = rand.Next(0, 0); // update for number of missions
     if (randNum == 0)
         environment_1(e, odd, player);
 }
开发者ID:craigmcmillan01,项目名称:C-sharp-Work,代码行数:7,代码来源:Environment.cs


示例13: SamplingRecordProvider

 internal SamplingRecordProvider(Environment environment, IEnvironmentService service,
     IRecordable recordable, int id, bool recordPeriodEnabled, TimeSpan recordPeriod)
     : base(environment, service, recordable, id)
 {
     this.recordPeriodEnabled = recordPeriodEnabled;
     this.recordPeriod = recordPeriod;
 }
开发者ID:Ce-Ma-S,项目名称:SenseLab.old,代码行数:7,代码来源:SamplingRecordProvider.cs


示例14: CreateScene

        /// <summary>
        /// This method create the initial scene
        /// </summary>
        protected override void CreateScene()
        {
            #region Basics
            physics = new Physics();

            robot = new Robot(mSceneMgr);
            robot.setPosition(new Vector3(000, 0, 300));
            environment = new Environment(mSceneMgr, mWindow);
            playerModel = new PlayerModel(mSceneMgr);
            playerModel.setPosition(new Vector3(0, -80, 50));
            playerModel.hRotate(new Vector3(600, 0, 0));
            #endregion

            #region Camera
            cameraNode = mSceneMgr.CreateSceneNode();
            cameraNode.AttachObject(mCamera);
            playerModel.AddChild(cameraNode);
            inputsManager.PlayerModel = playerModel;
            #endregion

            #region Part 9
            PlayerStats playerStats = new PlayerStats();
            gameHMD = new GameInterface(mSceneMgr, mWindow, playerStats);
            #endregion

            robots = new List<Robot>();
            robots.Add(robot);
            robotsToRemove = new List<Robot>();
            bombs = new List<Bomb>();
            bombsToRemove = new List<Bomb>();
            physics.StartSimTimer();
        }
开发者ID:Bobbylon5,项目名称:Mogre14,代码行数:35,代码来源:Tutorial.cs


示例15: DeviceProvider

 private DeviceProvider(Environment environment, IEnvironmentService service,
     Guid id, string name, string description)
     : base(id, name, description)
 {
     this.environment = environment;
     this.service = service;
 }
开发者ID:Ce-Ma-S,项目名称:SenseLab.old,代码行数:7,代码来源:DeviceProvider.cs


示例16: LoadData

        public void LoadData()
        {
            environment = World.Instance.Environment;
            environment.SkyBox.Create(device);

            ShaderConstants.LightDirection = new Vector4(environment.Stars[0].LightDirection.X,
                environment.Stars[0].LightDirection.Y,
                environment.Stars[0].LightDirection.Z,
                0);
            //environment = null;
            //Vector4 v=new Vector4(0, -0.5f, -1, 0);
            //v.Normalize();
            //ShaderConstants.LightDirection = v;
            ShaderConstants.Projection = device.Transform.Projection;

            ShaderConstants.LightColor = new ColorValue(1, 1, 1);

            //foreach (IGameObject obj in World.Instance.GameObjects)
            //{
            //    //if (obj is Ship)
            //    //{
            //    //    EngineEmitter em=new EngineEmitter(particleSystem);
            //    //    this.particleSystem.AddEmitter(em);
            //    //    shipEngineEmitters.Add(obj as Ship, em);
            //    //}
            //}

            World.Instance.OnObjectAdded += new ObjectEventHandler(World_OnObjectAdded);
            World.Instance.OnObjectRemoved += new ObjectEventHandler(World_OnObjectRemoved);

            World.Instance.OnCharacterAdded += new CharacterEventHandler(World_OnShipAdded);
            World.Instance.OnCharacterRemoved += new CharacterEventHandler(World_OnShipRemoved);
        }
开发者ID:kensniper,项目名称:castle-butcher,代码行数:33,代码来源:Renderer.cs


示例17: TransformDirectory

        public int TransformDirectory(string path, Environment targetEnvironment, bool deleteTemplate = true)
        {
            Log.DebugFormat("Transform templates for environment {1} ind {0} {2} deleting templates", path, targetEnvironment.Name, deleteTemplate ? "with" : "without");

            VariableResolver = new VariableResolver(targetEnvironment.Variables);

            int templateCounter = 0;

            foreach (var templateFile in _fileSystem.EnumerateDirectoryRecursive(path, "*.template.*", SearchOption.AllDirectories))
            {
                ++templateCounter;
                Log.Info(string.Format("  Transform template {0}", templateFile));

                var templateText = _fileSystem.ReadFile(templateFile);
                var transformed = VariableResolver.TransformVariables(templateText);

                _fileSystem.OverwriteFile(templateFile.Replace(".template.", ".").Replace(".Template.", "."), transformed);

                if (deleteTemplate)
                {
                    _fileSystem.DeleteFile(templateFile);
                }
            }

            Log.DebugFormat("Transformed {0} template(s) in {1}.", templateCounter, path);

            return templateCounter;
        }
开发者ID:tobiaszuercher,项目名称:PowerDeploy,代码行数:28,代码来源:TemplateEngine.cs


示例18: incrementFitness

 void incrementFitness(Environment environment, instance_pack ip) 
 {
     // Schrum: Added to avoid magic numbers and make purpose clear
     float MAX_DISTANCE = 300.0f;
     // Schrum: Last POI is actually goal: Return to start
     for (int i = 0; i < reachedPOI.Length; i++)
     {
         if (reachedPOI[i])
         {
             fitness += 1.0f;
         }
         else if (i == 3) { // Schrum: Hack: Last POI is actually the goal
             double gain = (1.0f - ip.robots[0].location.manhattenDistance(environment.goal_point) / MAX_DISTANCE);
             //Console.WriteLine("Goal Gain = " + gain);
             fitness += gain;
             break;
         }
         else
         {
             // Schrum: From HardMaze
             //fitness += (1.0f - ip.robots[0].location.distance(new Point2D(environment.POIPosition[i].X, environment.POIPosition[i].Y)) / 650.0f);
             // Schrum: Guessing at distance to divide by
             // Schrum: Switched to Manhattan distance since Team Patrol uses it
             double gain = (1.0f - ip.robots[0].location.manhattenDistance(new Point2D(environment.POIPosition[i].X, environment.POIPosition[i].Y)) / MAX_DISTANCE);
             //Console.WriteLine("Gain = " + gain);
             fitness += gain;
             break;
         }
     }
 }
开发者ID:jal278,项目名称:agent_multimodal,代码行数:30,代码来源:VisitThreeFitness.cs


示例19: MultiAgentExperiment

        public MultiAgentExperiment()
        {
            benchmark=false;
            multibrain = false;
            evolveSubstrate = false;

            collisionPenalty = false;
            //heterogenous trams by default
            homogeneousTeam = false;

            scriptFile = "";
            numberRobots = 1;
            //how many range finders
            rangefinderSensorDensity = 11; /*<------THIS MUST BE CHANGED FOR EACH ROBOT MODEL!!!*/
            timestep = 0.16f;

            evaluationTime = 100;

            explanatoryText = "Multi-Agent Experiment";
            //Environment = new List<Environment>();

            //Create an empty environment
            environment = new Environment();
            robots = new List<Robot>();

            fitnessFunctionName = "SingleGoalPoint";
            behaviorCharacterizationName = "EndPointBC";
            robotModelName = "PackBotModel";

            initialized = false;
            running = false;
        }
开发者ID:jtglaze,项目名称:IndependentWork2013,代码行数:32,代码来源:MultiAgentExperiment.cs


示例20:

		void ICanModifyContext.PopulateContext (Environment env, string ns)
		{
			Symbol _id = Symbol.CreateSymbol (id);

			if (!env.InCurrentScope (ns, _id))
				env.Enter (ns, _id, this);
		}
开发者ID:nickchal,项目名称:pash,代码行数:7,代码来源:VariableDeclaration.cs



注:本文中的Environment类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# EnvironmentVariableTarget类代码示例发布时间:2022-05-24
下一篇:
C# EnvelopeClass类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap