-
Notifications
You must be signed in to change notification settings - Fork 297
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API: Added external api which returns gainExperience #1955
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
ca5c33d
added new api call for experience gain returns list of experience for…
AdamAndreatta f51b075
finished api functionality
AdamAndreatta 82a8fde
edited documentation and ran tests/linting
AdamAndreatta db08b60
adjust api function works as intended
AdamAndreatta db8e5df
Got rid of unnecessary functions that merely duplicated other functio…
AdamAndreatta 5fba661
created a function which only handles calculations of exp for each va…
AdamAndreatta 37dfd62
changed the function to have a default value
AdamAndreatta 5ba867c
fixed formatting issue
AdamAndreatta 9daaf6d
Go rid of uneccessary function. Made calculation a member function so…
AdamAndreatta 0f5b2a2
Made gain exp recieve numCycles and pass it to the calculation function
AdamAndreatta b3bfce2
Fixed inconsitencies in naming for variables
AdamAndreatta 4b5171c
Adjusted comment in Netscript definitions.d.ts
AdamAndreatta 362edf2
adjust value definition for exp object GangMember.ts
AdamAndreatta 5412b49
Update interface defintions NetscriptDefinitions.d.ts
AdamAndreatta f7b737d
updated doc file
AdamAndreatta File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [bitburner](./bitburner.md) > [GangMemberExpGain](./bitburner.gangmemberexpgain.md) > [agi\_exp](./bitburner.gangmemberexpgain.agi_exp.md) | ||
|
||
## GangMemberExpGain.agi\_exp property | ||
|
||
Agi EXP gain for a member after a given task | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
agi_exp: number; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [bitburner](./bitburner.md) > [GangMemberExpGain](./bitburner.gangmemberexpgain.md) > [cha\_exp](./bitburner.gangmemberexpgain.cha_exp.md) | ||
|
||
## GangMemberExpGain.cha\_exp property | ||
|
||
Cha EXP gain for a member after a given task | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
cha_exp: number; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [bitburner](./bitburner.md) > [GangMemberExpGain](./bitburner.gangmemberexpgain.md) > [def\_exp](./bitburner.gangmemberexpgain.def_exp.md) | ||
|
||
## GangMemberExpGain.def\_exp property | ||
|
||
Def EXP gain for a member after a given task | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
def_exp: number; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [bitburner](./bitburner.md) > [GangMemberExpGain](./bitburner.gangmemberexpgain.md) > [dex\_exp](./bitburner.gangmemberexpgain.dex_exp.md) | ||
|
||
## GangMemberExpGain.dex\_exp property | ||
|
||
Dex EXP gain for a member after a given task | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
dex_exp: number; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [bitburner](./bitburner.md) > [GangMemberExpGain](./bitburner.gangmemberexpgain.md) > [hack\_exp](./bitburner.gangmemberexpgain.hack_exp.md) | ||
|
||
## GangMemberExpGain.hack\_exp property | ||
|
||
Hack EXP gain for a member after a given task | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
hack_exp: number; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [bitburner](./bitburner.md) > [GangMemberExpGain](./bitburner.gangmemberexpgain.md) | ||
|
||
## GangMemberExpGain interface | ||
|
||
|
||
**Signature:** | ||
|
||
```typescript | ||
interface GangMemberExpGain | ||
``` | ||
|
||
## Properties | ||
|
||
| Property | Modifiers | Type | Description | | ||
| --- | --- | --- | --- | | ||
| [agi\_exp](./bitburner.gangmemberexpgain.agi_exp.md) | | number | Agi EXP gain for a member after a given task | | ||
| [cha\_exp](./bitburner.gangmemberexpgain.cha_exp.md) | | number | Cha EXP gain for a member after a given task | | ||
| [def\_exp](./bitburner.gangmemberexpgain.def_exp.md) | | number | Def EXP gain for a member after a given task | | ||
| [dex\_exp](./bitburner.gangmemberexpgain.dex_exp.md) | | number | Dex EXP gain for a member after a given task | | ||
| [hack\_exp](./bitburner.gangmemberexpgain.hack_exp.md) | | number | Hack EXP gain for a member after a given task | | ||
| [str\_exp](./bitburner.gangmemberexpgain.str_exp.md) | | number | Str EXP gain for a member after a given task | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [bitburner](./bitburner.md) > [GangMemberExpGain](./bitburner.gangmemberexpgain.md) > [str\_exp](./bitburner.gangmemberexpgain.str_exp.md) | ||
|
||
## GangMemberExpGain.str\_exp property | ||
|
||
Str EXP gain for a member after a given task | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
str_exp: number; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [bitburner](./bitburner.md) > [GangMemberInfo](./bitburner.gangmemberinfo.md) > [expGain](./bitburner.gangmemberinfo.expgain.md) | ||
|
||
## GangMemberInfo.expGain property | ||
|
||
Per Cycle Exp object for each stat for this gang member. | ||
|
||
null in the event that the member does not have a given task. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
expGain: GangMemberExpGain | null; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have to explain the case in which it's null in the documentation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, just to make sure that this will work out fine. I separated the functions. One function independently handles the calculation of the exp that should be gained by the member. These calculations were already made in the original gainExperience function, I merely moved to another function within the formulas. I created a second function which receives those calculations in the form of an object from functionA the values from this object are added to the member's values own values. However, I was struggling very much so to find a way to ensure that the API could receive this object without duplicating exp gain. I settled on creating a getter function which is a GangMember function which receives a NumCycles value that is 1 since we are trying to calculate the exp gain of a task per cycle. There is no duplicate code and the calculations only happen once now with each function having one independent job. Please let me know if this works out if not I can attempt to adjust it more.