/// <summary>
        /// Merges the specified fixture
        /// </summary>
        /// <param name="fixture">The fixture</param>
        /// <param name="culture">The culture</param>
        /// <param name="useLock">Should the lock mechanism be used during merge</param>
        public new void MergeFixture(FixtureDTO fixture, CultureInfo culture, bool useLock)
        {
            if (useLock)
            {
                lock (MergeLock)
                {
                    base.MergeFixture(fixture, culture, false);
                    _categoryId = fixture.Tournament?.Category?.Id;

                    if (fixture.Type != null)
                    {
                        _stageType = fixture.Type.Value == SportEventType.Parent
                                         ? StageType.Parent
                                         : StageType.Child;
                    }
                }
            }
            else
            {
                base.MergeFixture(fixture, culture, false);
                _categoryId = fixture.Tournament?.Category?.Id;

                if (fixture.Type != null)
                {
                    _stageType = fixture.Type.Value == SportEventType.Parent
                                     ? StageType.Parent
                                     : StageType.Child;
                }
            }
        }
        /// <summary>
        /// Merges the specified event summary
        /// </summary>
        /// <param name="eventSummary">The event summary</param>
        /// <param name="culture">The culture</param>
        private void ActualMergeTournament(TournamentInfoDTO eventSummary, CultureInfo culture)
        {
            base.Merge(eventSummary, culture, false);

            if (eventSummary.Category != null)
            {
                _categoryId = eventSummary.Category.Id;
            }

            if (eventSummary.Type != null)
            {
                _stageType = eventSummary.Type.Value == SportEventType.Parent
                                 ? StageType.Parent
                                 : StageType.Child;
            }

            if (eventSummary.Competitors != null)
            {
                Competitors = new List <URN>(eventSummary.Competitors.Select(t => t.Id));
            }

            if (eventSummary.Category != null)
            {
                _categoryId = eventSummary.Category.Id;
            }
        }
Exemple #3
0
    /// <summary>
    /// 设置关卡副本数据
    /// <summary>
    public void SetStageData(StageType Type, int Chapter)
    {
        m_Type    = Type;
        m_Chapter = Chapter;
        CalcRoadState();

        SetUI();
    }
Exemple #4
0
 public List <int> GetMemberList(StageType levelType)
 {
     if (!this.teamDict.ContainsKey(levelType))
     {
         this.teamDict.Add(levelType, new List <int>());
     }
     return(this.teamDict[levelType]);
 }
Exemple #5
0
 public T GetStageByType <T>(StageType type) where T : BaseStage
 {
     if (_dictAllStages.ContainsKey(type))
     {
         return((T)_dictAllStages[type]);
     }
     return(null);
 }
 public Stage(int id, string label, string labelHuman, StageType type, bool isDLC = false)
 {
     _StageID         = id;
     _StageLabel      = label;
     _StageLabelHuman = labelHuman;
     _StageType       = type;
     _IsDLC           = isDLC;
 }
Exemple #7
0
 public void Init()
 {
     _curStage      = null;
     _curStageType  = StageType.None;
     _dictAllStages = new Dictionary <StageType, BaseStage>();
     _dictAllStages.Add(StageType.Home, new HomeStage());
     _dictAllStages.Add(StageType.Login, new LoginStage());
 }
Exemple #8
0
 public void ChangeStageToGame()
 {
     StageType                    = StageType.Game;
     TimeStopped                  = false;
     TimeText.enabled             = true;
     forgeOfTimeCamera.enabled    = false;
     psychedelicRunCamera.enabled = true;
 }
Exemple #9
0
 public bool IsBuiltin(StageType stage, string fieldName)
 {
     if (fieldName.StartsWith("gl_"))
     {
         return(true);
     }
     return(m_Builtins.ContainsKey(GetKey(stage, fieldName)));
 }
Exemple #10
0
 public bool HasTeamMember(StageType levelType, int num)
 {
     if (!this.teamDict.ContainsKey(levelType))
     {
         return(false);
     }
     return(num <= this.teamDict[levelType].Count);
 }
Exemple #11
0
        public void DrawIndexed(int indexCount, int instanceCount, int firstIndex, int vertexOffset, int firstInstance)
        {
            m_CompiledPipelineProgram.InitializePipeline();

            this.gl_InstanceIndex = firstInstance;
            this.CurrentStage     = StageType.InputAssembler;

            int indiceIndex = firstIndex;

            int[]                vertexIndex32 = new int[1];
            UInt16[]             vertexIndex16 = new ushort[1];
            SoftwareDeviceMemory sdmIndex      = (SoftwareDeviceMemory)m_context.m_CommandBuffer.m_context.m_IndexBuffer.m_deviceMemory;
            int        indexMemOffset          = m_context.m_CommandBuffer.m_context.m_IndexBuffer.m_memoryOffset;
            Func <int> getIndiceFunc;

            switch (m_context.m_CommandBuffer.m_context.m_IndexBufferType)
            {
            case VkIndexType.VK_INDEX_TYPE_UINT16:
                getIndiceFunc = () =>
                {
                    int srcOffset = indexMemOffset + (indiceIndex * 2);
                    Buffer.BlockCopy(sdmIndex.m_bytes, srcOffset, vertexIndex16, 0, 2);
                    return(vertexIndex16[0]);
                };
                break;

            case VkIndexType.VK_INDEX_TYPE_UINT32:
                getIndiceFunc = () =>
                {
                    int srcOffset = indexMemOffset + (indiceIndex * 4);
                    Buffer.BlockCopy(sdmIndex.m_bytes, srcOffset, vertexIndex32, 0, 4);
                    return(vertexIndex32[0]);
                };
                break;

            default:
                return;
            }

            for (int instanceNum = 0; instanceNum < instanceCount; instanceNum++)
            {
                indiceIndex = firstIndex;

                while (indexCount >= PrimitiveLength)
                {
                    for (int i = 0; i < PrimitiveLength; i++)
                    {
                        this.PrimitiveVertexIndex = i;
                        this.gl_VertexIndex       = getIndiceFunc();
                        m_CompiledPipelineProgram.VertexShader();
                        indiceIndex++;
                    }
                    RasterizeTriangle();
                    indexCount -= this.PrimitiveLength;
                }
                this.gl_InstanceIndex++;
            }
        }
Exemple #12
0
 public void SwitchTeamMember(StageType levelType, int numLeft, int numRight)
 {
     if (this.teamDict.ContainsKey(levelType))
     {
         int num = this.teamDict[levelType][numLeft - 1];
         this.teamDict[levelType][numLeft - 1]  = this.teamDict[levelType][numRight - 1];
         this.teamDict[levelType][numRight - 1] = num;
     }
 }
Exemple #13
0
 public Stage(string stagename, Vector2 basespeed, List<HookPoint> hookpoints, StageConditions stageconditions, StageType stagetype, List<Obstacle> obstacles)
 {
     _stageName = stagename;
     _baseSpeed = basespeed;
     _hookPoints = hookpoints;
     _stageConditions = stageconditions;
     _stageType = stagetype;
     _obstacles = obstacles;
 }
Exemple #14
0
 private void Initialize()
 {
     TimeLeft     = TotalTime;
     TimeStopped  = false;
     TimeFactor   = 1.0f;
     GameEnded    = false;
     StageType    = StageType.Game;
     _audioSource = GetComponent <AudioSource>();
 }
Exemple #15
0
 public StageNode(RoomManager manager, int stageDepth, int horizontalNum, StageType type, int pathRisk, int pathReward)
 {
     this.manager       = manager;
     this.stageDepth    = stageDepth;
     this.horizontalNum = horizontalNum;
     this.type          = type;
     this.pathRisk      = pathRisk;
     this.pathReward    = pathReward;
 }
Exemple #16
0
    //Method of getting particular resistance using enum types
    public float GetResistance(ResistanceType resistanceType, StageType stageType)
    {
        switch (stageType)
        {
        case StageType.Casual:
            switch (resistanceType)
            {
            case ResistanceType.Magical:
                return(resCasualMagical);

            case ResistanceType.Physical:
                return(resCasualPhysical);

            case ResistanceType.Pure:
                return(resCasualPure);

            default:
                throw new ArgumentOutOfRangeException();
            }

        case StageType.Boss:
            switch (resistanceType)
            {
            case ResistanceType.Magical:
                return(resBossMagical);

            case ResistanceType.Physical:
                return(resBossPhysical);

            case ResistanceType.Pure:
                return(resBossPure);

            default:
                throw new ArgumentOutOfRangeException();
            }

        case StageType.SuperBoss:
            switch (resistanceType)
            {
            case ResistanceType.Magical:
                return(resSuperBossMagical);

            case ResistanceType.Physical:
                return(resSuperBossPhysical);

            case ResistanceType.Pure:
                return(resSuperBossPure);

            default:
                throw new ArgumentOutOfRangeException();
            }

        default:
            throw new ArgumentOutOfRangeException();
        }
    }
Exemple #17
0
        public MetaEventStage(StageType type, string name, uint countdown = 0, bool isEndStage = false)
        {
            Type = type;
            Name = name;
            EventStates = new HashSet<EventState>();

            Countdown = countdown;

            IsEndStage = isEndStage;
        }
Exemple #18
0
        public bool Validate(StageType stage, FieldInfo fieldInfo)
        {
            string key = GetKey(stage, fieldInfo.Name);

            if (!m_Builtins.ContainsKey(key))
            {
                return(false);
            }
            return(true);
        }
        public static void Send(StageType type, int stageId, int times)
        {
            CGStageWipeout package = new CGStageWipeout();

            package.type    = type;
            package.stageId = stageId;
            package.times   = times;

            NetHandler.OnSend(704, NetHandler.Serialize(package));
        }
 public SoftwarePipelineProgram()
 {
     StageType[] list = new StageType[] { StageType.VertexShader, StageType.FragmentShader };
     foreach (var item in list)
     {
         ShaderEntry.Add(item, new List <Expression>());
         PreActions.Add(item, new List <Expression>());
         PostActions.Add(item, new List <Expression>());
     }
 }
Exemple #21
0
 public Map(MapData data)
 {
     Data    = data;
     MapData = new StageType[Data.Height, Data.Width];
     for (int i = 0; i < data.Data.Count; i++)
     {
         var stage = data.Data[i];
         MapData[stage.Y, stage.X] = stage.Type;
     }
 }
Exemple #22
0
        public void Add(StageType stage, string name, BuiltinFlags direction, Action onUseAction)
        {
            BuiltinVariableInfo info = new BuiltinVariableInfo();

            info.Name      = name;
            info.Stage     = stage;
            info.Flags     = direction | (onUseAction != null ? BuiltinFlags.HasAction : 0);
            info.UseAction = onUseAction;
            m_Builtins.Add(GetKey(info), info);
        }
Exemple #23
0
        public MetaEventStage(StageType type, string name, uint countdown = 0, bool isEndStage = false)
        {
            Type        = type;
            Name        = name;
            EventStates = new HashSet <EventState>();

            Countdown = countdown;

            IsEndStage = isEndStage;
        }
Exemple #24
0
        public StageAnchorData(StageType stageType)
        {
            _bubbleAnchors = new Vector2[GameConstant.StageRowCount][];
            for (var i = 0; i < _bubbleAnchors.Length; ++i)
            {
                _bubbleAnchors[i] = new Vector2[GameConstant.RowBubbMaxNum];
            }

            RebuildStage(stageType);
        }
Exemple #25
0
 void set_stagetype(int stagelv)
 {
     if (stagelv < 3)
     {
         stageType = StageType.DEFAULT;
     }
     else if (stagelv >= 3)
     {
         stageType = StageType.GHOST;
     }
 }
Exemple #26
0
 public IEnumerable <IStageHandler> GetHandlers(StageType stage)
 {
     if (this._hanlerMap.TryGetValue(stage, out var map))
     {
         return(map.Entries);
     }
     else
     {
         return(Enumerable.Empty <IStageHandler>());
     }
 }
Exemple #27
0
    void UpdateData(StageType Type, int Chapter)
    {
        m_type          = Type;
        m_Chapter       = Chapter;
        m_ChapterReward = StageM.GetChapterReward(m_type, m_Chapter);
        GetStarData();
        LoadStageContext(m_Chapter, m_type);
        SetUI();

        GetBoxDataStage();
    }
Exemple #28
0
 /// <summary>
 /// 获取关卡名称
 /// </summary>
 public static string GetChaptersName(int Chapters, StageType type)
 {
     foreach (s_counterpartInfo Info in m_lstage)
     {
         if (Info.chapters == Chapters && Info.type == (int)type)
         {
             return(Info.chaptersname);
         }
     }
     return(string.Empty);
 }
Exemple #29
0
 /// <summary>
 /// 确认是否包含该章。
 /// </summary>
 public static bool CheckHaveChapters(int Chapters, StageType type)
 {
     foreach (s_counterpartInfo Info in m_lstage)
     {
         if (Info.chapters == Chapters && Info.type == (int)type)
         {
             return(true);
         }
     }
     return(false);
 }
Exemple #30
0
        //sets up all of the variables for the stage
        public Stage(string stageName, StageType stageType)
        {
            this.SetName(stageName);
            this.StageType = stageType;
            this.AmbientLightLevel = Color.White;

            if (CurrentStage == null)
            {
                CurrentStage = this;
            }
        }
Exemple #31
0
 public void SetTeamMember(StageType levelType, int num, int avatarId)
 {
     if (num > this.teamDict[levelType].Count)
     {
         this.teamDict[levelType].Add(avatarId);
     }
     else
     {
         this.teamDict[levelType][num - 1] = avatarId;
     }
 }
Exemple #32
0
 /// <summary>
 /// 查找对应的副本数据
 /// <summary>
 private CounterPartInfo FindCounterpartInfo(StageType Type, int Chapter, int StageID)
 {
     foreach (CounterPartInfo Info in m_CounterInfo)
     {
         if (Info.id == StageM.GetStageID(Type, Chapter, StageID))
         {
             return(Info);
         }
     }
     return(null);
 }
Exemple #33
0
        public static ShaderStage FromFile(string path, StageType type)
        {
            if (!File.Exists(path))
            {
                throw new IOException($"Could not find file: {path}");
            }

            var lines = File.ReadAllLines(path);

            return(FromSource(lines, type));
        }
        protected override double GetAllowableTension(StageType Stage)
        {
            double fc = this.Section.Material.SpecifiedCompressiveStrength;
            double fci = this.prestressedSection.Material.InitialConcreteStrengthAtPrestress;
            double fct = 0;
            double sqrt_fc = Section.Material.Sqrt_f_c_prime;
            double sqrt_fci = Math.Sqrt(fci);
          
            switch (Stage)
            {
                case StageType.Jacking:
                    throw new InvalidStageException("allowable concrete tension");
                case StageType.Transfer:
                    switch (crossSectionLocationType)
	                    {
                            case CrossSectionLocationType.TypicalInterior:
                                fct= 3.0 * sqrt_fci;
                                break;
                            case CrossSectionLocationType.EndOfSImplySupported:
                                fct= 6.0 * sqrt_fci;
                                break;

	                    }
                    break;
                case StageType.Service:
                    switch (memberClass)
	                    {
                            case MemberClass.U:
                                fct = 7.5 * sqrt_fc;
                                break;
                            case MemberClass.T:
                                fct= 12.0 * sqrt_fc;
                                break;
                            case MemberClass.C:
                                fct= double.PositiveInfinity;
                                break;
                            case MemberClass.U_TwoWaySlab:
                                fct= 6.0* sqrt_fc;
                                break;
	                    }
                    break;

            }
            return fct;
        }
Exemple #35
0
        public Stage(string stageName, StageType stageType, Dimension stageSize)
        {
            this.SetName(stageName);
            this.StageType = stageType;
            this.AmbientLightLevel = Color.White;

            if (CurrentStage == null)
            {
                CurrentStage = this;
            }

            this.size = stageSize;

            //return;

            // Create a set of empty tiles.
            for (double w = 0; w < this.size.width; w++)
            {
                for (double h = 0; h < this.size.height; h++)
                {
                    this.AddTile("", true, true, new Point(w, h));
                }
            }
        }
Exemple #36
0
        void CPU_OnStageDone(StageType type)
        {
            //Console.WriteLine("Inside on stage done for: " + args.stageType.ToString());
            // if all threads are done (use bools)
            switch (type)
            {
                case StageType.Fetch:
                    fetchDone = true;
                    break;
                case StageType.Decode:
                    decodeDone = true;
                    break;
                case StageType.Execute:
                    executeDone = true;
                    break;
                case StageType.Store:
                    storeDone = true;
                    break;
            }

            lock (allStagesDoneLock)
            {                
                if (fetchDone && decodeDone && executeDone && storeDone)
                {
                    Console.WriteLine("called stage done event, " + type.ToString() + " was the last to finish.");
                    OnStageDone(this, new StageDoneEventArgs());
                }
            }
        }
Exemple #37
0
 public Stage(string name, decimal km, int day, DateTime hour, StageType st)
 {
     Name = name;
     StageTimes = new StageTime[MAX_STAGETIME];
 }
Exemple #38
0
        public smbStage(StageType stage)
        {
            string[] ports;

            m_stage = stage;
            switch (m_stage)
            {
                case StageType.ASI_MS2000:
                    ports = SerialPort.GetPortNames();
                    foreach (string port in ports)
                    {
                        try
                        {
                            m_serialport = new SerialPort(port);

                            m_serialport.BaudRate = 9600;
                            m_serialport.DataBits = 8;
                            m_serialport.Parity = Parity.None;
                            m_serialport.StopBits = StopBits.One;
                            m_serialport.Handshake = Handshake.None;

                            m_serialport.Open();

                            m_serialport.Write("N\r");
                            Thread.Sleep(200);
                            if (m_serialport.ReadExisting().Substring(7, 6) == "MS2000")
                            {
                                // Found Device
                                m_serialport.Write("W X Y Z\r");
                                Thread.Sleep(100);
                                string[] dists = m_serialport.ReadExisting().Split(' ');
                                m_distx = Convert.ToDouble(dists[1]);
                                m_disty = Convert.ToDouble(dists[2]);
                                m_distz = Convert.ToDouble(dists[3]);
                                break;
                            }
                            else { m_serialport.Close(); };
                        }
                        catch
                        {
                            m_serialport.Close();
                        }
                    }
                    break;
                case StageType.MCL_CFOCUS:
                    m_handle = CFocus.MCL_InitHandle();
                    if (m_handle == 0) throw new Exception();
                    double Cal = CFocus.MCL_GetCalibration(3, m_handle);
                    CFocus.MCL_SingleWriteN(Cal * .50, 3, m_handle);
                    m_distz = Cal * .50;
                    break;
                case StageType.PI_ZSTAGE:
                    ports = SerialPort.GetPortNames();
                    foreach (string port in ports)
                    {
                        try
                        {
                            m_serialport = new SerialPort(port);

                            m_serialport.BaudRate = 9600;
                            m_serialport.DataBits = 8;
                            m_serialport.Parity = Parity.None;
                            m_serialport.StopBits = StopBits.One;
                            m_serialport.Handshake = Handshake.None;

                            m_serialport.Open();

                            m_serialport.Write("*IDN?\n");
                            Thread.Sleep(200);
                            if (m_serialport.ReadExisting().Substring(0, 4) == "E516")
                            {
                                // Found Device
                                m_serialport.Write("ONL 1\n");
                                Thread.Sleep(100);
                                m_serialport.Write("VCO A1\n");
                                Thread.Sleep(100);
                                m_serialport.Write("VEL A100\n");
                                Thread.Sleep(100);
                                m_serialport.Write("NLM A19\n");
                                Thread.Sleep(100);
                                m_serialport.Write("MOV A60.00\n");
                                m_distz = 60.0;
                                break;
                            }
                            else { m_serialport.Close(); };
                        }
                        catch
                        {
                            m_serialport.Close();
                        }
                    }
                    if (!m_serialport.IsOpen) throw new Exception();
                    break;
                case StageType.PI_XYZNANOSTAGE:
                    StringBuilder sUsbController = new StringBuilder(1024);

                    GCS2.EnumerateUSB(sUsbController, 1024, "PI E-712");
                    m_iControllerId = GCS2.ConnectUSB(sUsbController.ToString());

                    if (m_iControllerId < 0) throw new Exception();

                    GCS2.ONL(m_iControllerId, new int [] {1, 2, 3}, new int[] {1, 1, 1}, 3);

                    GCS2.SVO(m_iControllerId, "1 2 3", new int[] { 1, 1, 1 });
                    GCS2.MOV(m_iControllerId, "1 2 3", new double[] { 0, 0, 0 });
                    break;

                case StageType.PI_PIEZOMIRROR:
                    ports = SerialPort.GetPortNames();
                    foreach (string port in ports)
                    {
                        try
                        {
                            m_serialport = new SerialPort(port);

                            m_serialport.BaudRate = 115200;
                            m_serialport.DataBits = 8;
                            m_serialport.Parity = Parity.None;
                            m_serialport.StopBits = StopBits.One;
                            m_serialport.Handshake = Handshake.None;

                            m_serialport.Open();

                            m_serialport.Write("*IDN?\n");
                            Thread.Sleep(200);
                            string recv_str = m_serialport.ReadExisting();
                            if (recv_str.Contains("E-517"))
                            {
                                // Found Device
                                m_serialport.Write("ONL 1 1 2 1\n");
                                Thread.Sleep(100);
                                m_serialport.Write("SVO 1 1 2 1\n");
                                Thread.Sleep(100);
                                m_serialport.Write("MOV 1 0 2 0\n");
                                Thread.Sleep(100);

                                m_distx = 0.0;
                                m_disty = 0.0;

                                break;
                            }
                            else { m_serialport.Close(); };
                        }
                        catch
                        {
                            m_serialport.Close();
                        }
                    }
                    if (!m_serialport.IsOpen) throw new Exception();
                    break;
            }
        }
 public MetaEventMultiLineStage(StageType type, string name, uint countdown = 0, bool isEndStage = false)
     : base(type, name, countdown, isEndStage)
 {
     m_SubStages = new Dictionary<string, MetaEventStage>();
     m_ActiveName = string.Empty;
 }
Exemple #40
0
        //depending on available stage types, maybe this function should infer stagetype from game context?
        public static Stage CreateStage(string stageName, StageType stageType, Dimension stageSize = null)
        {
            Stage newStage;
            if (stageSize != null)
            {
                newStage = new Stage(stageName, stageType, stageSize);
            }
            else
            {
                newStage = new Stage(stageName, stageType);
            }

            //if there is a main view with no stage, make this the attached stage
            if (View.GetMainView() != null && View.GetMainView().GetAttachedStage() == null)
            {
                View.GetMainView().AttachStage(newStage);
            }

            gameStages.Add(newStage);

            return newStage;
        }
        protected override double GetAllowableCompression(StageType Stage, LoadType LoadType)
        {
            double fc = this.Section.Material.SpecifiedCompressiveStrength;
            double fci = this.prestressedSection.Material.InitialConcreteStrengthAtPrestress;
            double fcc = 0;
            switch (Stage)
            {
                case StageType.Jacking:
                    throw new InvalidStageException("allowable concrete compression");
                case StageType.Transfer:
                    switch (crossSectionLocationType)
	                    {
                        case CrossSectionLocationType.TypicalInterior:
                                fcc = 0.6 * fci;
                            break;
                        case CrossSectionLocationType.EndOfSImplySupported:
                                fcc = 0.7 * fci;
                            break;
	                    }
                    break;
                case StageType.Service:
                    switch (LoadType)
	                    {
                            case LoadType.Sustained:
                                fcc = 0.45 * fc;
                                break;
                            case LoadType.Total:
                                fcc = 0.6 * fc;
                                break;
	                    }
                    break;

            }
            return fcc;
        }
	public void ShowMain ()
	{
		Debug.Log ("ShowMain");
		CurrentStageType = StageType.NONE;
		m_state.Ready ();

		m_pageFlip.SetPrevPage ();

		m_currentPageUp = newPage (m_pageMPrefab_up.gameObject, m_pageUpParent);
		m_currentPageDown = newPage (m_pageMPrefab_down.gameObject, m_pageDownParent);

		BGSound.Instance.Stop ();

		SetChagePage (PageType.MAIN);
	}
	private void SetStageState ()
	{
		if (CurrentStageType == StageType.NONE) {
			CurrentStageType = StageType.FIRST;
		} else if (CurrentStageType == StageType.FIRST || CurrentStageType == StageType.CONTINUE_FIRST) {
			CurrentStageType = StageType.NORMAL;
		}

		if (CurrentStageState == StageState.GAMEOVER || CurrentStageState == StageState.LEVEL_UP) {
			CurrentStageType = StageType.CONTINUE_FIRST;
			CurrentStageState = StageState.NONE;
		}
	}