Exemplo n.º 1
0
 /// <summary>
 /// 读取下一个对话
 /// </summary>
 /// <param name="readData">对话内容</param>
 /// <param name="commandAuto">自动执行指令</param>
 /// <returns>有可读的对话</returns>
 public static bool Next(ref ReadData readData, bool commandAuto = true)
 {
     if (Ins.m_currentData == null)
     {
         Debug.LogWarning("剧本未读取");
         return(false);
     }
     Ins.EndCurrentCommads();
     Ins.m_currentIndex++;
     if (Ins.CurrentDialogue == null)
     {
         if (Ins.m_currentData.nextScenario != null)
         {
             return(Read(Ins.m_currentData.nextScenario, ref readData, commandAuto));
         }
         else
         {
             Ins.m_currentIndex--;
             return(false);
         }
     }
     else
     {
         ReadDialogue(ref readData, commandAuto);
         return(true);
     }
 }
Exemplo n.º 2
0
 private void GoToIns()
 {
     Ins.SetActive(true);
     Posture.SetActive(false);
     TutorialCameraController.myCameraState = TutorialCameraController.CameraState.App;
     //HintPosInsBack 暂时不用
 }
Exemplo n.º 3
0
    public static void RequestPath(Vector2 pathStart, Vector2 pathEnd, Action <Vector2[], bool> callback)
    {
        PathRequest newRequest = new PathRequest(pathStart, pathEnd, callback);

        Ins.pathRequestQueue.Enqueue(newRequest);
        Ins.TryProcessNext();
    }
Exemplo n.º 4
0
    public void Particle(string name, Vector2 position, bool active = true, Transform parent = null)
    {
        GameObject     gameObject = ObjectPool.Ins.PopFromPool(name, position, active, parent);
        ParticleSystem particle   = gameObject.GetComponent <ParticleSystem>();

        Ins.StartCoroutine(Remover(gameObject, () => particle.isStopped));
    }
Exemplo n.º 5
0
        public void TestMoreExamplesO()
        {
            // ARRANGE
            using (FileStream FS = File.OpenRead("CodeFiles\\more_examples.o"))
            {
                byte[] Content = new byte[FS.Length];
                FS.Read(Content, 0, Content.Length);

                // ACT
                IEnumerable <Instruction> Instructions = Instruction.LinearSweep(Content);

                StringBuilder Buffer = new StringBuilder();

                foreach (Instruction Ins in Instructions)
                {
                    Buffer.AppendLine(Ins.ToString());
                }

                Buffer.Length += -2;

                string Commands = Buffer.ToString();

                // ASSERT
                Assert.True(!String.IsNullOrEmpty(Commands));
            }
        }
Exemplo n.º 6
0
        /// <summary>
        /// Plays a SoundConnection on SoundManager that matches the level name.
        /// </summary>
        /// <param name='levelName'>
        /// The levelName of the SoundConnection.
        /// </param>
        /// <param name='syncPlaybackTime'>
        /// Whether the playback times should be synced.
        /// </param>
        /// <param name='trackNumber'>
        /// Track number to skip to, starting at 0.
        /// </param>
        public static void PlayConnection(string levelName, bool syncPlaybackTime = false, int trackNumber = 0)
        {
            int         currentTimeSamples = 0;
            AudioSource currentSource      = null;

            if (syncPlaybackTime)
            {
                currentSource = GetCurrentAudioSource();
                if (currentSource != null)
                {
                    currentTimeSamples = currentSource.timeSamples;
                }
            }

            for (int i = 0; i < trackNumber; i++)
            {
                Next();
            }
            Ins._PlayConnection(levelName);

            if (syncPlaybackTime)
            {
                currentSource = GetCurrentAudioSource();
                if (currentTimeSamples > currentSource.clip.samples)
                {
                    Debug.LogWarning("Your clips are not of equal length. SyncPlayback has restarted the new track");
                    currentTimeSamples = 0;
                }
                currentSource.timeSamples = currentTimeSamples;
            }
        }
Exemplo n.º 7
0
 public static DataCollectionViewEntity toDataCollectionEntity(this Ins ins)
 {
     return(new DataCollectionViewEntity()
     {
         Id = ins.InsOwnId,
         CarLicPlateAssociationId = ins.InsCarTarId,
         EntityId = ins.InsChrTo,
         AddressValueFrom = ins.InsIndFrom,
         ReturnKm = ins.InsKmInt,
         ExitKm = ins.InsKmOut,
         PathologyId = ins.InsPatId,
         PatientId = ins.InsPerId,
         ServiceDate = ins.InsSvrDat,
         ServiceType = ins.InsTyp,
         Rescuer1Id = ins.InsSoc1Id,
         Rescuer2Id = ins.InsSoc2Id.HasValue ? ins.InsSoc2Id.Value : -1,
         DriverId = ins.InsAutId,
         BillNumber = ins.InsBilNum,
         ReturnTime = ins.InsTimIn,
         ExitTime = ins.InsTimOut,
         TagNumber = ins.InsCrtNum,
         PlaceValueFrom = ins.InsPlcFrom,
         PlaceValueTo = ins.InsPlcTo,
         AddressValueTo = ins.InsIndTo
     });
 }
Exemplo n.º 8
0
            private void Awake()
            {
                Vehicle = GetComponent <BaseEntity>();
                if (Vehicle == null)
                {
                    End();
                }
                var Boat   = Vehicle as MotorRowboat;
                var Copter = Vehicle as MiniCopter;

                if (Boat)
                {
                    FuelTank = Boat.fuelStorageInstance.Get(true).GetComponent <StorageContainer>();
                }
                else if (Copter)
                {
                    FuelTank = Copter.fuelStorageInstance.Get(true).GetComponent <StorageContainer>();
                }
                else
                {
                    End();
                }
                Ins.cachedVehicles.Add(this);
                if (Ins.cachedVehicles.Count == 1)
                {
                    Ins.Subscribe("OnItemRemovedFromContainer");
                    Ins.Subscribe("OnEntityDismounted");
                    Ins.Subscribe("CanLootEntity");
                }

                if (FuelTank.inventory.GetSlot(0) == null)
                {
                    AddFuel();
                }
            }
Exemplo n.º 9
0
 /// <summary>
 /// 移除一个事件
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="listener"></param>
 public static void RemoveListener <T>(EventDelegate <T> listener) where T : EventObject
 {
     if (!IsIns)
     {
         return;
     }
     Ins.RemoveListenerInternal(listener);
 }
Exemplo n.º 10
0
        private Ins GetOpCode(ushort word0)
        {
            int opCodeNum = word0 & opcodeH;

            Ins opCode = (Ins)opCodeNum;

            return(opCode);
        }
Exemplo n.º 11
0
 /**
  * Constructeur avec parametres
  * @param x : position du bouton en x
  * @param y : position du bouton en y
  * @param up : chemin relatif de l'image du bouton non appuye
  * @param hover : chemin relatif de l'image du bouton survol
  * @param son : recuperation du son
  */
 public BoutonTexture(float posX, float posY, TypeBouton normal, TypeBouton hover, TypeBouton appuyer) : base(posX, posY)
 {
     mSprtNormal           = Ins.GetSpriteBouton(normal);
     mSprtHover            = Ins.GetSpriteBouton(hover);
     mSprtAppuyer          = Ins.GetSpriteBouton(appuyer);
     mSprtNormal.Position  = new Vector2f(mPositionX, mPositionY);
     mSprtHover.Position   = new Vector2f(mPositionX, mPositionY);
     mSprtAppuyer.Position = new Vector2f(mPositionX, mPositionY);
 }
Exemplo n.º 12
0
        public void Test_for_DIV()
        {
            string code      = "DIV A,B";
            var    statement = li.Interpret(code);
            Ins    expected  = Ins.DIV;

            Assert.AreEqual(expected, statement.Instruction);
            Assert.AreEqual(0x06, (Int16)expected);
        }
Exemplo n.º 13
0
        public void Test_for_SUB()
        {
            string code      = "SUB A,B";
            var    statement = li.Interpret(code);
            Ins    expected  = Ins.SUB;

            Assert.AreEqual(expected, statement.Instruction);
            Assert.AreEqual(0x03, (Int16)expected);
        }
Exemplo n.º 14
0
        public void Test_for_ADD()
        {
            string code      = "ADD A,B";
            var    statement = li.Interpret(code);
            Ins    expected  = Ins.ADD;

            Assert.AreEqual(expected, statement.Instruction);
            Assert.AreEqual(0x02, (Int16)expected);
        }
Exemplo n.º 15
0
        public void Test_for_IFU()
        {
            string code      = "IFU A,B";
            var    statement = li.Interpret(code);
            Ins    expected  = Ins.IFU;

            Assert.AreEqual(expected, statement.Instruction);
            Assert.AreEqual(0x17, (Int16)expected);
        }
Exemplo n.º 16
0
        public void Test_for_XOR()
        {
            string code      = "XOR A,B";
            var    statement = li.Interpret(code);
            Ins    expected  = Ins.XOR;

            Assert.AreEqual(expected, statement.Instruction);
            Assert.AreEqual(0x0C, (Int16)expected);
        }
Exemplo n.º 17
0
 private static void ReadDialogue(ref ReadData readData, bool commandAuto)
 {
     readData.SetData(Ins.m_currentData, Ins.CurrentDialogue);
     Ins.RefreshCommandTime();
     if (commandAuto)
     {
         Ins.DoCurrentCommands();
     }
 }
Exemplo n.º 18
0
        public void Test_for_MLI()
        {
            string code      = "MLI A,B";
            var    statement = li.Interpret(code);
            Ins    expected  = Ins.MLI;

            Assert.AreEqual(expected, statement.Instruction);
            Assert.AreEqual(0x05, (Int16)expected);
        }
Exemplo n.º 19
0
        /// <summary>
        /// Gets the current song.
        /// </summary>
        /// <returns>
        /// The current song.
        /// </returns>
        public static AudioClip GetCurrentSong()
        {
            if (!Ins.IsPlaying() || Ins.currentSource.clip == null)
            {
                return(null);
            }

            return(Ins.currentSource.clip);
        }
Exemplo n.º 20
0
        // 异步加载场景
        public static void LoadSceneAsync(string sceneName)
        {
            foreach (var syss in _Sys)
            {
                syss.OnSceneExit(_CurScene);
            }

            _LoadingAo = SceneManager.LoadSceneAsync(sceneName);
            Ins.StartCoroutine(LoadScene(_LoadingAo, sceneName));
        }
Exemplo n.º 21
0
 public void Update()
 {
     if (Ins.Union(Outs).Select(f => f.TableName).Distinct().Count() > 1)
     {
         QueryType = QueryType.MultiTable;
     }
     else
     {
         QueryType = QueryType.SingleTable;
     }
 }
Exemplo n.º 22
0
            private Dictionary <int, Ins> page = new Dictionary <int, Ins>(); // 页

            public Page(int startPos, int inTime)
            {
                this.inTime   = inTime;
                lastUseTime   = inTime;
                this.startPos = startPos / 10 * 10;

                for (int i = 0; i < 10; ++i)
                {
                    Ins newIns = insList[this.startPos + i];
                    page.Add(i, newIns);
                }
            }
Exemplo n.º 23
0
        public void Reducerile(string[,] matriceTerm)
        {
            productii.Add("E E");
            foreach (var In in listeGenerate)
            {
                foreach (string Ins in In)
                {
                    //E E.
                    if (Ins.IndexOf(".") == (Ins.Count() - 1))
                    {
                        // E E.
                        int    indexIn = DaIndexList(listeGenerate, In);
                        string ceva    = EliminaPuncat(Ins);
                        // E E
                        char urmator = Ins[0];

                        string prod = eliminaPrmElementProductie(ceva);
                        // E

                        for (int i = 0; i < productii.Count(); i++)
                        {
                            string fff            = productii[i];
                            string pro            = eliminaPrmElementProductie(productii[i]);
                            int    indexProductie = i + 1;

                            if (pro == " E" && ceva == "E E" && urmator == 'E')
                            {
                                int coloana = terminali.IndexOf("$");
                                matriceTerm[indexIn, coloana] = "acc" + " ";
                            }


                            else if (prod == pro)
                            {
                                for (int j = 0; j < urmatorii.Count; j++)
                                {
                                    if (urmatorii[j].StartsWith(urmator.ToString()))
                                    {
                                        string[] urmatorul = urmatorii[j].Split(' ');
                                        foreach (var item in urmatorul[1])
                                        {
                                            int coloana = terminali.IndexOf(item.ToString());
                                            matriceTerm[indexIn, coloana] = "r" + indexProductie + " ";
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
Exemplo n.º 24
0
        /*重写Cache区域内容*/
        public void writeNewCache(int cacheNum, Page page)
        {
            string  cacheName   = "listBox" + cacheNum.ToString();
            ListBox refreashBox = (ListBox)this.Controls.Find(cacheName, true)[0];

            refreashBox.Items.Clear();
            for (int offset = 0; offset < 10; ++offset)
            {
                Ins    ins         = page.findCertainIns(offset);
                string instruction = ins.pos.ToString() + ":" + ins.content + ' ' + ins.nextPos.ToString();
                refreashBox.Items.Add(instruction);
            }
        }
    private void Awake()
    {
        if (GetComponent <Image>() != null)
        {
            thisImage = GetComponent <Image>();
        }
        else if (GetComponent <Text>() != null)
        {
            thisText = GetComponent <Text>();
        }

        doThis = Ins.Rup;
    }
Exemplo n.º 26
0
        public Action <IOperandVal, IOperandVal, IDCPU> GetOperations(Ins instruction)
        {
            Action <IOperandVal, IOperandVal, IDCPU> value;

            if (operationTable.TryGetValue(instruction, out value))
            {
                return(value);
            }
            else
            {
                //TODO: Throw Exception
                return(null);
            }
        }
Exemplo n.º 27
0
 public static void RemoveEnemy(Enemy enemy)
 {
     if (enemy == Ins.selectedEnemy)
     {
         if (Ins.enemyList.Count > 1)
         {
             Ins.SelectEnemy(Ins.enemyList[(Ins.enemyList.IndexOf(enemy) + 1) % Ins.enemyList.Count]);
         }
     }
     Ins.enemyList.Remove(enemy);
     if (Ins.enemyList.Count == 0)
     {
         Ins.result = BattleResult.Win;
         BattleManager.sResult();
     }
 }
Exemplo n.º 28
0
            public void End(bool remove = false)
            {
                FuelTank?.inventory?.Clear();
                if (remove)
                {
                    Ins.cachedVehicles.Remove(this);
                    if (Ins.cachedVehicles.Count < 1)
                    {
                        Ins.Unsubscribe("OnItemRemovedFromContainer");
                        Ins.Unsubscribe("OnEntityDismounted");
                        Ins.Unsubscribe("CanLootEntity");
                    }
                }

                Destroy(this);
            }
Exemplo n.º 29
0
            /// <summary>
            /// n秒后开启一个回调
            /// </summary>
            public void StartCounting(float n, Action callBack)
            {
                if (n <= 0f)
                {
                    return;
                }

                _isRepeat     = false;
                _callBack     = callBack;
                _repeatTime   = 0;
                _intervalTime = n;
                _currTimer    = 0f;
                _counter      = 0;
                Start();
                Ins.Add(this);
            }
Exemplo n.º 30
0
    public void ClickBackButtonIns()
    {
        Debug.Log("ClickInsBack");
        if (deactiveButtons)
        {
            return;
        }
        HintScreen.SetActive(false);
        Ins.SetActive(false);
        Hide(CameraBackground);


        TutorialCameraController.myCameraState = TutorialCameraController.CameraState.Subway;

        forwardOneStep = true;
    }