Add getVarpValue and setVarpValue to RSClientMixin and Client

This commit is contained in:
Adam
2018-07-09 08:54:50 -04:00
parent d8b2e743ac
commit 2aa08231a2
2 changed files with 36 additions and 0 deletions

View File

@@ -659,6 +659,28 @@ public interface Client extends GameEngine
@VisibleForDevtools @VisibleForDevtools
int getVarbitValue(int[] varps, int varbitId); int getVarbitValue(int[] varps, int varbitId);
/**
* Gets the value of a given VarPlayer.
*
* @param varps passed varps
* @param varpId the VarpPlayer id
* @return the value
* @see VarPlayer#id
*/
@VisibleForDevtools
int getVarpValue(int[] varps, int varpId);
/**
* Sets the value of a given VarPlayer.
*
* @param varps passed varps
* @param varpId the VarpPlayer id
* @param value the value
* @see VarPlayer#id
*/
@VisibleForDevtools
void setVarpValue(int[] varps, int varpId, int value);
/** /**
* Sets the value of a given variable. * Sets the value of a given variable.
* *

View File

@@ -385,6 +385,20 @@ public abstract class RSClientMixin implements RSClient
return varps[varPlayer.getId()]; return varps[varPlayer.getId()];
} }
@Inject
@Override
public int getVarpValue(int[] varps, int varpId)
{
return varps[varpId];
}
@Inject
@Override
public void setVarpValue(int[] varps, int varpId, int value)
{
varps[varpId] = value;
}
@Inject @Inject
@Override @Override
public boolean isPrayerActive(Prayer prayer) public boolean isPrayerActive(Prayer prayer)