Exemplo n.º 1
0
 /// <summary>
 /// Creates an empty MSB2 for SotFS.
 /// </summary>
 public MSB2()
 {
     Format    = MSBFormat.DarkSouls2Scholar;
     Models    = new ModelParam();
     Events    = new EventParam();
     Regions   = new PointParam();
     Parts     = new PartsParam();
     PartPoses = new List <PartPose>();
 }
Exemplo n.º 2
0
 // calculate and display measure result
 private void CalculateAndDisplay(EventParam param)
 {
     if (pathInstance != null)
     {
         pathInstance.Calculate();
         pathInstance.Display();
         clickCount = 0;
     }
 }
 // safely close files when simulation stops
 private void CloseFiles(EventParam param)
 {
     marker.Close();
     wulff.Close();
     pathDistance.Close();
     planeDistance.Close();
     pointsAngle.Close();
     planeAngle.Close();
 }
Exemplo n.º 4
0
    //

    //Event functions
    public void DispatchEvent <T>(Shell.Event eventId, string key, T data)
    {
        EventParam param = new EventParam();

        param.EventID = (int)eventId;
        param.Add <string>("tag", key);
        param.Add <T>(key, data);
        EventManager.Instance.RaiseEvent(eventId, param);
    }
Exemplo n.º 5
0
    public static void RaiseEvent(EventNames eventName, EventParam eventParam)
    {
        Action <EventParam> thisEvent = null;

        if (eventDictionary.TryGetValue(eventName, out thisEvent))
        {
            thisEvent.Invoke(eventParam);
        }
    }
Exemplo n.º 6
0
    public void ModifyParam(EventParam param)
    {
        List <string> keys = new List <string>(param.argsDic.Keys);

        for (int index = 0; index < keys.Count; ++index)
        {
            argsDic[keys[index]] = param.argsDic[keys[index]];
        }
    }
Exemplo n.º 7
0
    void destroy(EventParam eventParam)
    {
        if (trail != null && trail.enabled)
        {
            trail.enabled = false;
        }

        freeAssets();
    }
Exemplo n.º 8
0
 private void UpdateMultiplier(EventParam param)
 {
     if (_multiplierValueText != null)
     {
         _multiplierValueText.text = param.Score.ToString();
         _multiplierValueText.transform.localScale += Vector3.one * 10f;
         _isShrinking = true;
     }
 }
Exemplo n.º 9
0
 public void DispathEvent(string eventId, EventParam param)
 {
     if (eventDic.ContainsKey(eventId))
     {
         eventDic[eventId](param);
         param.ClearData();
         paramList.Add(param);
     }
 }
    public static void TriggerEvent(string eventName, EventParam param)
    {
        Action <EventParam> thisEvent = null;

        if (instance.eventDictionary.TryGetValue(eventName, out thisEvent))
        {
            thisEvent.Invoke(param);
        }
    }
Exemplo n.º 11
0
        /// <summary>
        /// Deserializes file data from a stream.
        /// </summary>
        protected override void Read(BinaryReaderEx br)
        {
            br.BigEndian = false;

            br.AssertASCII("MSB ");
            br.AssertInt32(1);
            br.AssertInt32(0x10);
            br.AssertBoolean(false); // isBigEndian
            br.AssertBoolean(false); // isBitBigEndian
            br.AssertByte(1);        // textEncoding
            br.AssertByte(0xFF);     // is64BitOffset

            Entries entries = default;

            Models             = new ModelParam();
            entries.Models     = Models.Read(br);
            Events             = new EventParam();
            entries.Events     = Events.Read(br);
            Regions            = new PointParam();
            entries.Regions    = Regions.Read(br);
            Routes             = new RouteParam();
            entries.Routes     = Routes.Read(br);
            Layers             = new LayerParam();
            entries.Layers     = Layers.Read(br);
            Parts              = new PartsParam();
            entries.Parts      = Parts.Read(br);
            PartsPoses         = new MapstudioPartsPose();
            entries.PartsPoses = PartsPoses.Read(br);
            BoneNames          = new MapstudioBoneName();
            entries.BoneNames  = BoneNames.Read(br);

            if (br.Position != 0)
            {
                throw new InvalidDataException("The next param offset of the final param should be 0, but it wasn't.");
            }

            MSB.DisambiguateNames(entries.Models);
            MSB.DisambiguateNames(entries.Parts);
            MSB.DisambiguateNames(entries.Regions);

            foreach (Event evt in entries.Events)
            {
                evt.GetNames(this, entries);
            }
            foreach (Region region in entries.Regions)
            {
                region.GetNames(this, entries);
            }
            foreach (Part part in entries.Parts)
            {
                part.GetNames(this, entries);
            }
            foreach (PartsPose pose in entries.PartsPoses)
            {
                pose.GetNames(this, entries);
            }
        }
Exemplo n.º 12
0
    public void ShowWindow(string windowName, EventParam param, Action OnComplete)
    {
        UIBaseWindow window = LoadWindow(windowName);

        if (null != window)
        {
            window.ShowWindow(param, OnComplete);
        }
    }
Exemplo n.º 13
0
 private void WaitSingleEventParam_OnEvent(EventParam param)
 {
     if (param is UnitStateEvent && ((UnitStateEvent)param)._owner == unit)
     {
         owner.stateMachine.ChangeState(
             new TurnMgr_PlayerBegin_(owner, unit),
             StateMachine <TurnMgr> .StateTransitionMethod.JustPush);
     }
 }
Exemplo n.º 14
0
 void beat(EventParam eventParam)
 {
     if (time < 0)
     {
         time   = duration;
         endPos = startPos + endPosOffset;
         //Debug.Log("HALLWAY " + startPos + " " + endPos + " " + duration);
     }
 }
Exemplo n.º 15
0
    /// <summary>
    /// Trigger an Event
    /// </summary>
    /// <param name="_eventName"></param>
    public static void TriggerEvent(string _eventName, EventParam _eventParam = default)
    {
        Action <EventParam> _thisEvent = null;

        // Trigger the event by getting it from the Dictionary and Invoking it
        if (instance.eventDictionary.TryGetValue(_eventName, out _thisEvent))
        {
            _thisEvent.Invoke(_eventParam);
        }
    }
Exemplo n.º 16
0
 void miss(EventParam eventParam)
 {
     if (!scoreUIText.isActiveAndEnabled)//ignore score notifications if the scoreUI (showing points) is not enabled
     {
         return;
     }
     initNotification(0);
     combo = 0;
     EventManager.TriggerEvent(EventManager.EVENT_COMBO_CHAIN, new EventParam((float)combo / maxCombo));
 }
Exemplo n.º 17
0
 public void MessageProc(uint msgId, EventParam param)
 {
     for (int index = 0; index < windowLst.Count; ++index)
     {
         if (windowLst[index].IsShow)
         {
             windowLst[index].MessageProc(msgId, param);
         }
     }
 }
Exemplo n.º 18
0
 /// <summary>
 /// Creates a new MSB3 with all sections empty.
 /// </summary>
 public MSB3()
 {
     Models     = new ModelParam();
     Events     = new EventParam();
     Regions    = new PointParam();
     Routes     = new List <Route>();
     Layers     = new List <Layer>();
     Parts      = new PartsParam();
     PartsPoses = new List <PartsPose>();
 }
Exemplo n.º 19
0
    void DestroyReaminingMeshes(EventParam nullParam)
    {
        // this method is called when strating the simulation to free memory space
        int childCount = gameObject.transform.childCount;

        for (int i = 0; i < childCount; i++)
        {
            Destroy(gameObject.transform.GetChild(0).gameObject);
        }
    }
 public void ReleaseGrabbedElement(EventParam voidParam)
 {
     // the release action is not linked to measure pointer to avoid bugs
     if (grabbedElement)
     {
         EventManager.TriggerEvent("StopUpdatingLines", null);
         StopCoroutine("UpdateElementTransform");
         isGrabbed = false;
     }
 }
    protected override void OnEvent(EventParam param)
    {
        _elList.Remove(el);
        _e.Unregister(el);

        if (_elList.Count == 0)
        {
            owner.stateMachine.ChangeState(_nextState, StateMachine <TurnMgr> .StateTransitionMethod.PopNPush);
        }
    }
    /// <summary>
    /// This function is called when START_GAME event is triggered
    /// getting an EventParam as parameter
    /// </summary>
    private void OnInitGame(EventParam evParam)
    {
        // ... do something

        // triggering the event INITIALIZE and passing as parameter an EventParam with a string value
        EventManager.TriggerEvent(
            EventManager.EVENT_TYPE.INITIALIZE,
            new EventParam {
            strParam = "Game initialized";
        }
Exemplo n.º 23
0
    public void Invoke(EventParam param = null)
    {
        //eListeners.ForEach(l => l.OnNotify.Invoke());
        foreach (var l in eListeners.ToArray())
        {
            l.OnNotify.Invoke(param);
        }

        listenerCount = eListeners.Count;
    }
Exemplo n.º 24
0
    private void OnSkinChanged(EventParam param)
    {
        string tag       = param.GetString("tag");
        int    skinIndex = param.GetInt(tag);

        GameSetting.Instance.currentCardSkin = skinIndex;

        StartCoroutine(ChangeCardSkin(skinIndex));
        AppController.Instance.SaveSetting();
        //Utilities.Instance.DispatchEvent(Solitaire.Event.SaveData, "save_data", 0);
    }
Exemplo n.º 25
0
 public void AddEventParam(Event eEvent, EventParam param, EventParamName name, decimal value)
 {
     if (param == null || eEvent == null)
     {
         return;
     }
     param.Event          = eEvent;
     param.Value          = value;
     param.EventParamName = name;
     dssDbContext.EventParams.Local.Add(param);
 }
Exemplo n.º 26
0
    void setLaneSize(EventParam eventParam)
    {
        int i = eventParam.int1;

        if (i > laneEndSizes.Length)
        {
            i = 0;
        }
        selectedLaneEndSize = i;
        initLanes();
    }
Exemplo n.º 27
0
        public EventWithParamViewModel(EventWithParamListViewModel eventWithParamListViewModel)
        {
            var ev         = new Event();
            var paramValue = new EventParam();

            this.EventWithParamListViewModel = eventWithParamListViewModel;
            this.Name            = ev.Name;
            this.Probability     = ev.Probability;
            this.EventParam      = paramValue;
            this.AddEventCommand = new DelegateCommand <object>(this.OnAddEvent, this.CanAddEvent);
        }
Exemplo n.º 28
0
 /// <summary>
 /// Creates a new MSB3 with all sections empty.
 /// </summary>
 public MSB3()
 {
     Models     = new ModelParam();
     Events     = new EventParam();
     Regions    = new PointParam();
     Routes     = new RouteParam();
     Layers     = new LayerParam();
     Parts      = new PartsParam();
     PartsPoses = new MapstudioPartsPose();
     BoneNames  = new MapstudioBoneName();
 }
Exemplo n.º 29
0
 /// <summary>
 /// Creates an MSBS with nothing in it.
 /// </summary>
 public MSBS()
 {
     Models     = new ModelParam();
     Events     = new EventParam();
     Regions    = new PointParam();
     Routes     = new RouteParam();
     Parts      = new PartsParam();
     Layers     = new EmptyParam(0x23, "LAYER_PARAM_ST");
     PartsPoses = new EmptyParam(0, "MAPSTUDIO_PARTS_POSE_ST");
     BoneNames  = new EmptyParam(0, "MAPSTUDIO_BONE_NAME_STRING");
 }
Exemplo n.º 30
0
        void DormantCurrPlayer()
        {
            //Remove current block from queue
            BlockQueue.Dequeue();
            //Set Color to "dormant"
            currPlayer.GetComponent <SpriteRenderer>().color = Color.white;
            //Play Dormant sound
            EventParam eventParam = new EventParam();

            Managers.EventManager.TriggerEvent("PlayLandSound", eventParam);
        }