public void AddMeatNotEmptyArrayZeroVector() { MultiMeshMeat.Meat newMeat = (MultiMeshMeat.Meat) new MultiMeshMeat.Meat(); MultiMeshMeat MMM = new MultiMeshMeat(); Spatial meatSpatial = new Spatial(); CreatureCollider collider = new CreatureCollider(); MMM.GetMeatToAdd().Add(newMeat); MMM.AddMeat(meatSpatial, collider); Assert.IsEqual(2, MMM.GetMeatToAdd().Count, "Then it Passes!"); Assert.IsEqual(new Vector3(), ((Godot.Collections.Array <MultiMeshMeat.Meat>)MMM.GetMeatToAdd())[1].meatSpatial.Translation, "Then it Passes!"); }
public void UpdateMeatBiomassOneElementArrayFractions() { float Y = 0.3f; MultiMeshMeat MMM = new MultiMeshMeat(); MultiMeshMeat.Meat meat = new MultiMeshMeat.Meat(); meat.meatSpatial = new Spatial(); meat.meatSpatial.Scale = new Vector3(Y, 0, 0); MMM.GetMeatArray().Add(meat); MMM.UpdateMeatBiomass(); Assert.IsEqual(0.3f, MMM.GetMeatBiomassArray()[0], "Then it passes"); }
public void UpdateMeatBiomassOneElementArrayWholeNumbers() { int Y = 1; MultiMeshMeat MMM = new MultiMeshMeat(); MultiMeshMeat.Meat meat = new MultiMeshMeat.Meat(); meat.meatSpatial = new Spatial(); meat.meatSpatial.Scale = new Vector3(Y, 0, 0); MMM.GetMeatArray().Add(meat); MMM.UpdateMeatBiomass(); Assert.IsEqual(1f, MMM.GetMeatBiomassArray()[0], "Then it passes"); }
public void UpdateMeatBiomassMultiElementArrayFractions() { int X = 3; float Y = 0.3f; float Z = 0.3f + 0.3f + 0.3f; MultiMeshMeat MMM = new MultiMeshMeat(); for (int i = 0; i < X; i++) { MultiMeshMeat.Meat meat = new MultiMeshMeat.Meat(); meat.meatSpatial = new Spatial(); meat.meatSpatial.Scale = new Vector3(Y, 0, 0); MMM.GetMeatArray().Add(meat); } MMM.UpdateMeatBiomass(); Assert.IsEqual(Z, MMM.GetMeatBiomassArray()[0], "Then it passes"); }
public void SaveFromNotEmptyArray() { const int X = 1; const int Y = 13; MultiMeshMeat MMM = new MultiMeshMeat(); MultiMeshMeat.Meat newMeat = (MultiMeshMeat.Meat) new MultiMeshMeat.Meat(); CreatureCollider collider = new CreatureCollider(); Spatial meatSpatial = new Spatial(); collider.MyMeat = newMeat; collider.MyCreatureAlive = false; newMeat.meatSpatial = meatSpatial; newMeat.Collider = collider; MMM.GetMeatArray().Add(newMeat); Assert.IsEqual(X, MMM.Save().Count, "Then it passes"); Assert.IsTrue(MMM.Save()[0] is Godot.Collections.Dictionary, "Then it passes"); Assert.IsEqual(Y, ((Godot.Collections.Dictionary)MMM.Save()[0]).Count, "Then it passes"); }