2022-10-21 20:01:01 +00:00
|
|
|
/*
|
|
|
|
* This file is part of ComputerCraft - http://www.computercraft.info
|
|
|
|
* Copyright Daniel Ratcliffe, 2011-2022. Do not distribute without permission.
|
|
|
|
* Send enquiries to dratcliffe@gmail.com
|
|
|
|
*/
|
|
|
|
package dan200.computercraft.core.computer;
|
|
|
|
|
2022-12-03 15:02:00 +00:00
|
|
|
import dan200.computercraft.api.filesystem.WritableMount;
|
2022-12-09 22:01:01 +00:00
|
|
|
import dan200.computercraft.core.filesystem.WritableFileMount;
|
2022-10-22 00:35:04 +00:00
|
|
|
import dan200.computercraft.core.metrics.MetricsObserver;
|
2022-10-21 20:01:01 +00:00
|
|
|
|
|
|
|
import javax.annotation.Nullable;
|
|
|
|
|
|
|
|
public interface ComputerEnvironment {
|
|
|
|
/**
|
|
|
|
* Get the current in-game day.
|
|
|
|
*
|
|
|
|
* @return The current day.
|
|
|
|
*/
|
|
|
|
int getDay();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the current in-game time of day.
|
|
|
|
*
|
|
|
|
* @return The current time.
|
|
|
|
*/
|
|
|
|
double getTimeOfDay();
|
|
|
|
|
2022-10-22 00:35:04 +00:00
|
|
|
/**
|
|
|
|
* Get the {@link MetricsObserver} for this computer. This should be constant for the duration of this
|
|
|
|
* {@link ComputerEnvironment}.
|
|
|
|
*
|
|
|
|
* @return This computer's {@link MetricsObserver}.
|
|
|
|
*/
|
|
|
|
MetricsObserver getMetrics();
|
|
|
|
|
2022-10-21 20:01:01 +00:00
|
|
|
/**
|
|
|
|
* Construct the mount for this computer's user-writable data.
|
|
|
|
*
|
|
|
|
* @return The constructed mount or {@code null} if the mount could not be created.
|
2022-12-09 22:01:01 +00:00
|
|
|
* @see WritableFileMount
|
2022-10-21 20:01:01 +00:00
|
|
|
*/
|
|
|
|
@Nullable
|
2022-12-03 15:02:00 +00:00
|
|
|
WritableMount createRootMount();
|
2022-10-21 20:01:01 +00:00
|
|
|
}
|