public NPCDefinition() { name = new FantasyName(); gender = Gender.None; species = Species.None; size = BodySize.None; faction = Faction.None; key = ""; model = ""; minLevel = 0; maxLevel = 0; expPerLevel = 0; baseStart = new List <int>(); BasePerLevel = new List <GameValue>(); derivedPerLevel = new List <GameValue>(); skillStart = new List <int>(); skillPerLevel = new List <GameValue>(); baseResistances = new List <int>(); resistancePerLevel = new List <GameValue>(); abilities = new List <Ability>(); inventory = new CharacterInventory(); }
private bool CheckIfFits(BodySize animalSize) { if ((usedSpace + (int)animalSize) <= maxSize) { return(true); } return(false); }
//constructor public ConstructionWorker(string name, bool isMale, HeadSize workerHeadSize, ArmSize workerArmSize, BodySize workerBodySize, LegSize workerLegSize, FootSize workerFootSize) { Name = name; _isMale = isMale; WorkerHeadSize = workerHeadSize; WorkerArmSize = workerArmSize; WorkerBodySize = workerBodySize; WorkerLegSize = workerLegSize; WorkerFootSize = workerFootSize; }
public NPCDefinition(FantasyName name, Species species, BodySize size, Gender gender, string key, string model, Faction faction, int minLevel, int maxLevel, int expPerLevel) { this.name = name; this.species = species; this.size = size; this.gender = gender; this.key = key; this.model = model; this.faction = faction; this.minLevel = minLevel; this.maxLevel = maxLevel; this.expPerLevel = expPerLevel; baseStart = new List <int>(); BasePerLevel = new List <GameValue>(); for (int i = 0; i < (int)BaseAttribute.Number; i++) { baseStart.Add(0); BasePerLevel.Add(new GameValue()); } derivedPerLevel = new List <GameValue>(); for (int i = 0; i < (int)DerivedAttribute.Number; i++) { derivedPerLevel.Add(new GameValue()); } skillStart = new List <int>(); skillPerLevel = new List <GameValue>(); for (int i = 0; i < (int)Skill.Number; i++) { skillStart.Add(0); skillPerLevel.Add(new GameValue()); } baseResistances = new List <int>(); resistancePerLevel = new List <GameValue>(); for (int i = 0; i < (int)DamageType.Number; i++) { baseResistances.Add(0); resistancePerLevel.Add(new GameValue()); } abilities = new List <Ability>(); inventory = new CharacterInventory(); }
public override int GetHashCode() { unchecked // disable overflow, for the unlikely possibility that you { // are compiling with overflow-checking enabled int hash = 27; hash = (13 * hash) + Position.GetHashCode(); hash = (13 * hash) + Velocity.GetHashCode(); hash = (13 * hash) + Acceleration.GetHashCode(); hash = (13 * hash) + Lifespan.GetHashCode(); hash = (13 * hash) + Mass.GetHashCode(); hash = (13 * hash) + BodySize.GetHashCode(); hash = (13 * hash) + HistoryLength.GetHashCode(); hash = (13 * hash) + InitialVelocitySet.GetHashCode(); hash = (13 * hash) + Orientation.GetHashCode(); return(hash); } }
public bool Equals(ParticleType p) { // If parameter is null return false: if (p == null) { return(false); } // Return true if the fields match: return(Position.Equals(p.Position) && Velocity.Equals(p.Velocity) && Acceleration.Equals(p.Acceleration) && Lifespan.Equals(p.Lifespan) && Mass.Equals(p.Mass) && BodySize.Equals(p.BodySize) && HistoryLength.Equals(p.HistoryLength) && InitialVelocitySet.Equals(p.InitialVelocitySet) && Orientation.Equals(Orientation)); }
public override void Draw(UISpriteBatch batch) { if (!Visible) { return; } var whitepx = TextureGenerator.GetPxWhite(batch.GraphicsDevice); DrawLocalTexture(batch, whitepx, null, new Vector2(0, StartOff), BodySize.ToVector2() - new Vector2(0, StartOff), Color); Rectangle lastRect; Point start; Point inc; int total; float rotate = 0; switch (DiagSide) { case UIDiagonalStripeSide.RIGHT: start = new Point(BodySize.X, 0); inc = new Point(0, 64); total = (int)Math.Ceiling(BodySize.Y / 64f); lastRect = new Rectangle(0, 0, 32, BodySize.Y % 64); break; case UIDiagonalStripeSide.BOTTOM: start = new Point(BodySize.X, BodySize.Y); inc = new Point(-64, 0); total = (int)Math.Ceiling(BodySize.X / 64f); lastRect = new Rectangle(0, 0, 32, BodySize.X % 64); rotate = (float)(Math.PI / 2); break; case UIDiagonalStripeSide.LEFT: start = new Point(0, BodySize.Y); inc = new Point(0, -64); total = (BodySize.Y + 63) / 64; lastRect = new Rectangle(0, 0, 32, BodySize.Y % 64); rotate = (float)(Math.PI); break; default: start = new Point(0, 0); inc = new Point(64, 0); total = (int)Math.Ceiling(BodySize.X / 64f); lastRect = new Rectangle(0, 0, 32, BodySize.X % 64); rotate = (float)(Math.PI * 3 / 2); break; } if (lastRect.Width == 0) { lastRect.Width = 64; } if (lastRect.Height == 0) { lastRect.Height = 64; } for (int i = 0; i < total; i++) { if (i == 0 && StartOff != 0) { DrawLocalTexture(batch, Diag, new Rectangle(0, StartOff, 32, 64 - StartOff), start.ToVector2() + new Vector2(0, StartOff), Vector2.One, Color, rotate); } else { DrawLocalTexture(batch, Diag, (i == total - 1)?(Rectangle?)lastRect:null, start.ToVector2(), Vector2.One, Color, rotate); } start += inc; } }