Skip to content

Commit

Permalink
Merge pull request #93 from vedant-shroff/develop
Browse files Browse the repository at this point in the history
Added Genome related events
  • Loading branch information
e-aakash authored Aug 11, 2020
2 parents 10acfb9 + c38d62d commit 3cd8ac7
Show file tree
Hide file tree
Showing 8 changed files with 361 additions and 59 deletions.
3 changes: 2 additions & 1 deletion module.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"dependencies": [
{ "id": "CoreAssets", "minVersion": "2.0.1" },
{ "id": "Inventory", "minVersion": "1.1.0" },
{ "id": "ModuleTestingEnvironment", "minVersion": "0.2.0", "optional": true }
{ "id": "ModuleTestingEnvironment", "minVersion": "0.2.0", "optional": true },
{ "id": "Genome", "minVersion": "1.0.0" , "optional": true }
],
"isServerSideOnly": false,
"isLibrary": true
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Copyright 2020 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0

package org.terasology.simpleFarming.events;

import org.terasology.entitySystem.Component;
import org.terasology.entitySystem.event.Event;
import org.terasology.logic.common.RetainComponentsComponent;

public class AddGenomeRetention implements Event {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* Copyright 2020 MovingBlocks
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.terasology.simpleFarming.events;

import org.terasology.entitySystem.entity.EntityRef;
import org.terasology.entitySystem.event.Event;

/**
* Sent to a plant just before it has been planted
*/
public class BeforePlanted implements Event {
private EntityRef seed;

public BeforePlanted(EntityRef seed) {
this.seed = seed;
}

public EntityRef getSeed() {
return seed;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@



/*
* Copyright 2020 MovingBlocks
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.terasology.simpleFarming.events;

import org.terasology.entitySystem.entity.EntityRef;
import org.terasology.entitySystem.event.Event;

/**
* Sent when produce is harvested from a bush
* This can be used to identify both the bush that was harvested as well as the produce
*/
public class ProduceCreated implements Event {
private EntityRef creator;
private EntityRef produce;

public ProduceCreated(EntityRef creator, EntityRef produce) {
this.creator = creator;
this.produce = produce;
}

public EntityRef getCreator() {
return creator;
}

public EntityRef getProduce() {
return produce;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Copyright 2020 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0

package org.terasology.simpleFarming.events;

import org.terasology.entitySystem.entity.EntityRef;
import org.terasology.entitySystem.event.Event;

/**
* Transfers GenomeComponent of the calling entity to another entity
* used to enforce optional dependencies
*/
public class TransferGenomeEvent implements Event {
/**
* The entity to which the GenomeComponent is to be transferred
*/
private EntityRef transferEntity;

public TransferGenomeEvent(EntityRef transferEntity) {
this.transferEntity = transferEntity;
}

public EntityRef getTransferEntity() {
return transferEntity;
}
}
Loading

0 comments on commit 3cd8ac7

Please sign in to comment.