Esempio n. 1
0
        private Tag ReadNewGlobalTag(ParsedString parsed, EnviromentType enviroment)
        {
            var available = Syntax.GlobalTags.Select(Syntax.GetTag).Where(t => t.Enviroment.HasFlag(enviroment)).ToList();
            var started   = available.Where(t => t.Begin.IsMatch(parsed)).OrderByDescending(t => t.Begin.Length).ToList();

            return(started.FirstOrDefault());
        }
Esempio n. 2
0
 public Player(int width, int height, bool autoHitbox, string autoHitboxName, EnviromentType environment) : base(width, height, autoHitbox, autoHitboxName)
 {
     health = 16;
     lifes = 3;
     energy = 100;
     movSpeed = 100;
     gravitySpeed = 0;
     keyMap = new KeyMap(KeyCode.W, KeyCode.S, KeyCode.A, KeyCode.D, KeyCode.E, KeyCode.Space);
     currentEnviroment = environment;
 }
Esempio n. 3
0
 public ApusPaymentsAPI(EnviromentType sandBox)
 {
     if (sandBox == EnviromentType.SandBox)
     {
         this.SandBox = true;
     }
     else
     {
         this.SandBox = false;
     }
 }
Esempio n. 4
0
 private bool ReadCloseOfTag(ParsedString parsed, Tag current, EnviromentType enviroment)
 {
     if (current.Enviroment.HasFlag(enviroment))
     {
         if (current.End.IsMatch(parsed, parsed.Length - current.End.Length))
         {
             return(true);
         }
     }
     return(false);
 }
Esempio n. 5
0
File: Tag.cs Progetto: anaym/md
        //потому что запрещены regexp-ы
        public Tag(string name, Template begin, Template end, IEnumerable<string> nestedTags, int groupIndex, string groupName, bool isRootableTag, EnviromentType enviroment)
        {
            if (name == null) throw new ArgumentNullException(nameof(name));
            if (begin == null) throw new ArgumentNullException(nameof(begin));
            if (end == null) throw new ArgumentNullException(nameof(end));
            if (name == "") throw new ArgumentException(nameof(name));

            Name = name;
            Begin = begin;
            End = end;
            GroupIndex = groupIndex;
            this.nestedTags = nestedTags?.ToList() ?? new List<string>();
            GroupName = groupName;
            IsRootableTag = isRootableTag;
            Enviroment = enviroment;
        }
Esempio n. 6
0
 private void ReadNext(ref Tag currentTag, ParsedString parsed, EnviromentType env, string current, List <SyntaxNode> buffer, List <SyntaxNode> result)
 {
     if (currentTag != null)
     {
         if (ReadCloseOfTag(parsed, currentTag, env))
         {
             buffer.AddRange(Parse(current.Substring(0, current.Length - currentTag.End.Length)).NestedNodes);
             result.Add(SyntaxNode.CreateTag(currentTag.Name).AddManyNestedNode(buffer));
             buffer.Clear();
             currentTag = null;
         }
         else
         {
             buffer.AddRange(Parse(current.Substring(0, current.Length - 1)).NestedNodes);
         }
     }
 }
Esempio n. 7
0
        public static EnviromentType GetType(string prev, string next)
        {
            EnviromentType prevType = EnviromentType.PreviousLineIsMissing;
            EnviromentType nextType = EnviromentType.NextLineLineIsMissing;

            if (prev != null)
            {
                prevType = string.IsNullOrWhiteSpace(prev)
                    ? EnviromentType.PreviousLineIsEmpty
                    : EnviromentType.PreviousIsNonEmpty;
            }
            if (next != null)
            {
                nextType = string.IsNullOrWhiteSpace(next)
                    ? EnviromentType.NextLineIsEmpty
                    : EnviromentType.NextIsNonEmpty;
            }
            return(prevType | nextType);
        }
 public void CheckWallCount()
 {
     if (currentWallsCount == 0)
     {
         GetRandomWalls();
         currentEnviroment = (EnviromentType)Random.Range(0, 3);
         if (currentEnviroment == EnviromentType.Castle)
         {
             currentWallsCount = castlesCount;
         }
         if (currentEnviroment == EnviromentType.Forest)
         {
             currentWallsCount = forestCount;
             AchievementManager.reachedForest = true;
         }
         else
         {
             currentWallsCount = cavesCount;
             AchievementManager.reachedCaves = true;
         }
     }
 }
Esempio n. 9
0
        public static Application GetConfiguredApplication(EnviromentType aEnviromentType)
        {
            var location = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);

            if (string.IsNullOrEmpty(location))
            {
                location = "";
            }

            var path = Path.Combine(location, "images");

            mApplication = Application.GetInstance();

            mDeviceControl = new PA1Control();

            mMeasureController = new MeasureProcessController(mDeviceControl)
            {
                SwitchWindowAction = windowName =>
                {
                    var rv = mApplication.GetWindows().First(w => w.Name == windowName) as Window;

                    if (rv != null)
                    {
                        if (rv.OnShow != null)
                        {
                            rv.OnShow();
                        }
                    }

                    mApplication.SetFocusedWindow(rv);
                }
            };

            /* Номера окон:
             * 1 - Главное меню;
             * 2 - ввод данных;
             * 3 - диалоговое окно 1 (подготовка к анализу);
             * 4.1 - измерение начального потенциала, процесс
             * 4.2 - измерение начального потенциала, результат
             * 4.3 - неудовлетворительное значение при измерении начального потенциала
             * 4.4 - график измерения начального потенциала
             * 5 - диалоговое окно;
             * 6 - ...
             * 7 - результаты измерения;
             *
             * 8.1 - окно с текстом перед началом отмывки;
             * 8.2 - окно со статусом отмывки;
             * 8.3 - окно с текстом по окончании отмывки;
             * 8.4 - промежуточное окно по окончании n-го цикла;
             *
             *  9 - настройки;
             * 10.1 - выбор архива; 10.2 - фильтр выбора архива;
             * 11.1 - содержимое архива;
             * 11.2 - график архива.
             * */

            mKeyboardWindow = new KeyboardWindow("keyboard_window");
            mApplication.AddWindow(mKeyboardWindow);


            mApplication.AddWindow(CreateWindow1(path)); // стартовое окно

            mApplication.AddWindow(CreateWindow2(path)); // начало анализа
            mApplication.AddWindow(CreateWindow3(path));

            mApplication.AddWindow(CreateWindow6_1(path));
            mApplication.AddWindow(CreateWindow6_2(path));
            mApplication.AddWindow(CreateWindow6_3(path));

            mApplication.AddWindow(CreateWindow7(path));   // результат

            mApplication.AddWindow(CreateWindow9_1(path)); // настройки
            mApplication.AddWindow(CreateWindow9_2(path));
            mApplication.AddWindow(CreateWindow9_3(path));
            mApplication.AddWindow(CreateWindow9_4(path));
            mApplication.AddWindow(GetLoadingWindow(path));

            mApplication.AddWindow(CreateWindow10_1(path)); // работа с архивом
            mApplication.AddWindow(CreateWindow11(path));

            //mApplication.SetFocusedWindow("keyboard_window");
            //mApplication.SetFocusedWindow("window9_3");
            mApplication.SetFocusedWindow("window1");

            return(mApplication);
        }
Esempio n. 10
0
 public PlayerEarth(int width, int height, bool autoHitbox, string autoHitboxName, EnviromentType environment) : base(width, height, autoHitbox, autoHitboxName, environment)
 {
     isRight = true;
     X = 1280 / 2f;
     Y = -height;
 }
Esempio n. 11
0
		public PlayerWater(int width, int height, bool autoHitbox, string autoHitboxName, EnviromentType Enviroment)
			: base(width, height, autoHitbox, autoHitboxName, Enviroment)
		{
			bulletsShot = new List<Bullet>();
		}
 void Awake()
 {
     GetRandomWalls();
     currentEnviroment = EnviromentType.Castle;
     currentWallsCount = castlesCount;
 }
Esempio n. 13
0
 public PlayerAir(int width, int height, bool autoHitbox, string autoHitboxName, EnviromentType environment) : base(width, height, autoHitbox, autoHitboxName, environment)
 {
 }
    // Update is called once per frame
    void Update()
    {
        if (hasFrontWall == false)           //use forloop
        {
            float distanceBehind = (GetComponent <Renderer>().bounds.size.z / 2);

            if (GameObject.FindWithTag("Player").GetComponent <Rigidbody>().position.z < (transform.position.z + distanceBehind))
            {
                int            chance = Random.Range(0, 11);
                GameObject     wallType;
                EnviromentType enviromentType = enviromentScript.Enviroment;
                if (enviromentType == EnviromentType.Castle)
                {
                    if (chance < Const_Script.NormalWallSpawn)
                    {
                        wallType = GameObject.FindWithTag("Wall_Manager").GetComponent <TypesOfWalls>().normal;
                    }
                    else if (chance < Const_Script.SideWallSpawn)
                    {
                        if (Random.Range(0, 2) == 0)
                        {
                            wallType = GameObject.FindWithTag("Wall_Manager").GetComponent <TypesOfWalls>().oneSideL;
                        }
                        else
                        {
                            wallType = GameObject.FindWithTag("Wall_Manager").GetComponent <TypesOfWalls>().oneSideR;
                        }
                    }
                    else if (chance < Const_Script.BridgeWallSpawn)
                    {
                        wallType = GameObject.FindWithTag("Wall_Manager").GetComponent <TypesOfWalls>().sides;
                    }
                    else
                    {
                        wallType = GameObject.FindWithTag("Wall_Manager").GetComponent <TypesOfWalls>().tower;
                    }
                }
                else if (enviromentType == EnviromentType.Forest)
                {
                    wallType = GameObject.FindWithTag("Wall_Manager").GetComponent <TypesOfWalls>().forest;
                }
                else
                {
                    wallType = GameObject.FindWithTag("Wall_Manager").GetComponent <TypesOfWalls>().caves;
                }

                Quaternion newWallRotation = transform.rotation;
                Vector3    newWallPosition = new Vector3(0, 0, (this.transform.position.z - (GetComponent <Renderer>().bounds.size.z / 2)) - (wallType.GetComponent <Renderer>().bounds.size.z / 2));
                GameObject newWall         = Instantiate(wallType, newWallPosition, newWallRotation) as GameObject;
                newWall.transform.parent = GameObject.FindWithTag("Wall_Manager").transform;
                nextWall     = newWall;
                hasFrontWall = true;

                WallSpawner script = newWall.GetComponent <WallSpawner>();
                script.previousWall     = this.gameObject;
                script.enviromentScript = this.gameObject.GetComponentInParent <EnviromentManager> ();
                enviromentScript.WallsCount--;
                enviromentScript.CheckWallCount();
            }
        }

        if (GameObject.FindWithTag("Player").transform.position.z < (this.transform.position.z - DestroyDistance - GetComponent <Renderer>().bounds.size.z / 2))
        {
            Destroy(gameObject);
        }
    }
Esempio n. 15
0
 public Species(int estimatedLenOfLife, EnviromentType environment)
 {
     this.estimatedLenOfLife = estimatedLenOfLife;
     this.environment        = environment;
 }