Skip to content

Commit

Permalink
Creatures can be marked as dead (not considered in topcreatures anymo…
Browse files Browse the repository at this point in the history
…re etc).
  • Loading branch information
cadon committed Mar 20, 2016
1 parent 0c480f8 commit 62d0125
Show file tree
Hide file tree
Showing 7 changed files with 496 additions and 408 deletions.
10 changes: 9 additions & 1 deletion ARKBreedingStats/Creature.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public class Creature
public string species;
public string name;
public Gender gender;
public CreatureStatus status;
// order of the stats is Health, Stamina, Oxygen, Food, Weight, MeleeDamage, Speed, Torpor
public int[] levelsWild;
public int[] levelsDom;
Expand Down Expand Up @@ -52,6 +53,7 @@ public Creature(string species, string name, string owner, Gender gender, int[]
else
this.tamingEff = tamingEff;
this.isBred = isBred;
this.status = CreatureStatus.Alive;
initVars();
}

Expand Down Expand Up @@ -118,6 +120,12 @@ public enum Gender
{
Unknown = 0,
Male = 1,
Female = 2,
Female = 2
};

public enum CreatureStatus
{
Alive,
Dead
};
}
27 changes: 14 additions & 13 deletions ARKBreedingStats/CreatureBox.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 10 additions & 2 deletions ARKBreedingStats/CreatureBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public partial class CreatureBox : UserControl
Creature creature;
private StatDisplay[] stats;
private NumericUpDown[] numUDLevelsDom;
public delegate void ChangedEventHandler(object sender, int listViewIndex, Creature creature);
public delegate void ChangedEventHandler(object sender, int listViewIndex, Creature creature, bool creatureStatusChanged);
public event ChangedEventHandler Changed;
public delegate void EventHandler(object sender, Creature creature);
public event EventHandler NeedParents;
Expand Down Expand Up @@ -63,6 +63,8 @@ private void initializeVars()
tt.SetToolTip(comboBoxFather, "Father");
tt.SetToolTip(textBoxNote, "Note");
tt.SetToolTip(labelParents, "Mother and Father (if bred and choosen)");
tt.SetToolTip(buttonGender, "Gender");
tt.SetToolTip(checkBoxDead, "Has the creature passed away?");
}

public void setCreature(Creature creature)
Expand Down Expand Up @@ -187,6 +189,7 @@ private void updateLabel()
}
for (int s = 0; s < 8; s++) { updateStat(s); }
labelNotes.Text = creature.note;
checkBoxDead.Checked = (creature.status == CreatureStatus.Dead);
}

private void closeSettings(bool save)
Expand Down Expand Up @@ -227,7 +230,11 @@ private void closeSettings(bool save)
creature.levelsDom[s] = (int)numUDLevelsDom[s].Value;
}
creature.note = textBoxNote.Text;
Changed(this, indexInListView, creature);
CreatureStatus newStatus = (checkBoxDead.Checked ? CreatureStatus.Dead : CreatureStatus.Alive);
bool creatureStatusChanged = (creature.status != newStatus);
creature.status = newStatus;

Changed(this, indexInListView, creature, creatureStatusChanged);
updateLabel();
ResumeLayout();
}
Expand All @@ -242,6 +249,7 @@ public void Clear()
closeSettings(false);
labelGender.Text = "";
groupBox1.Text = "";
checkBoxDead.Checked = false;
creature = null;
for (int s = 0; s < 8; s++)
{
Expand Down
Loading

0 comments on commit 62d0125

Please sign in to comment.