Skip to content

Commit

Permalink
Added a ShouldScale attribute to PlacedOrganelles
Browse files Browse the repository at this point in the history
  • Loading branch information
CoreyHendrey committed Jun 5, 2020
1 parent a3d3874 commit e80ba52
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/microbe_stage/OrganelleDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,11 @@ and the capacity of the process
/// </summary>
public float OrganelleCost { get; private set; }

/// <summary>
/// Should this organelle scale?
/// </summary>
public bool ShouldScale { get; private set; }

[JsonIgnore]
public List<IOrganelleComponentFactory> ComponentFactories
{
Expand Down
1 change: 1 addition & 0 deletions src/microbe_stage/organelle_components/NucleusComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ public class NucleusComponent : IOrganelleComponent
{
public void OnAttachToCell(PlacedOrganelle organelle)
{
organelle.ShouldScale = false;
}

public void OnDetachFromCell(PlacedOrganelle organelle)
Expand Down
5 changes: 5 additions & 0 deletions src/microbe_stage/organelle_components/PilusComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ public class PilusComponent : ExternallyPositionedComponent
uint ownerId;
float pilusSize = 4.6f;

public new void OnAttachToCell(PlacedOrganelle organelle)
{
organelle.ShouldScale = false;
}

protected override void CustomAttach()
{
base.CustomAttach();
Expand Down

1 comment on commit e80ba52

@hhyyrylainen
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be a json loaded property

Please sign in to comment.