What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal

Can anyone explain me what this code does?

17N

New Member
Joined
Jan 24, 2014
Messages
278
Reaction score
2
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))))

                );
        }
 
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))))

                );
        }

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#
 
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#

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:
Back
Top