• Visit Rebornbuddy
  • Can anyone explain me what this code does?

    Discussion in 'Community Developer Forum' started by 17N, Mar 15, 2014.

    1. 17N

      17N New Member

      Joined:
      Jan 24, 2014
      Messages:
      278
      Likes Received:
      2
      Trophy Points:
      0
      Can someone explain me in details what exactly this code do?

      I would appreciate it!



      Code:
      public static Composite Cast(string spell, UnitSelectionDelegate onUnit, Selection<bool> reqs = null)
              {
                  return
                      new Decorator(
                          ret => (onUnit != null && onUnit(ret) != null && (reqs == null || reqs(ret)) && AbilityManager.CanCast(spell, onUnit(ret))),
                          new PrioritySelector(
                              new Action(delegate {
                                  Logging.Write(">> Casting <<   " + spell);
                                  return RunStatus.Failure; }),
                              new Action(ret => AbilityManager.Cast(spell, onUnit(ret))))
      
                      );
              }
       
    2. Dreadlord

      Dreadlord New Member

      Joined:
      Nov 15, 2011
      Messages:
      451
      Likes Received:
      4
      Trophy Points:
      0
      lol, if you don't know how to code you shouldn't be messing with the files, you can only do more harm than good.
      This is a rotation code which you don't need to be playing with unless you have some knowledge in C#
       
    3. 17N

      17N New Member

      Joined:
      Jan 24, 2014
      Messages:
      278
      Likes Received:
      2
      Trophy Points:
      0
      I believe there is a logic error on what I wrote

      same question applies here

      Code:
       public static Composite WaitForCast()
              {
                  return new Decorator(ret => BuddyTor.Me.IsCasting,
                      new Action(ret => RunStatus.Success));
              }
      I am trying to debug what happens and the rotation hangs in PVP.
      I don't "buy it" that swtor is poorly written, so that BW does not work in PVP.
      I believe there is a logic error somewhere that I don't know where yet.
       
      Last edited: Mar 15, 2014

    Share This Page