예제 #1
0
 public DoJobState(GridActor actor, IGenericSaveData save, LilLogger logger) : base(((SaveData)save).parent)
 {
     this.actor  = actor;
     this.logger = logger;
     this.work   = LoadWork(((SaveData)save).workSave);
     logger.Log("Loading my DoJobState");
 }
예제 #2
0
 public DorfController(String name, GridActor actor, LilLogger logger)
 {
     this.name      = name;
     this.gridActor = actor;
     this.logger    = logger;
     stateMachine   = new StateMachine(new ChoosingJobState(gridActor, logger));
 }
예제 #3
0
 public MiningJob(GridActor actor, MiningRequest request, LilLogger logger)
 {
     Debug.Assert(request != null);
     this.logger = logger;
     Debug.Log("Started a mining job");
     machine = new StateMachine(new WalkToBlockState(actor, request, logger));
 }
예제 #4
0
 public MineBlockState(GridActor user, MiningRequest request, LilLogger logger)
 {
     this.user    = user;
     this.request = request;
     this.logger  = logger;
     logger.Log("Entering MineBlockState with request " + request);
 }
예제 #5
0
 public DoJobState(IJob work, GridActor actor, LilLogger logger)
 {
     this.actor  = actor;
     this.logger = logger;
     this.work   = work;
     logger.Log("Initializing my DoJobState");
 }
예제 #6
0
 public FindItemState(GridActor actor, MoveItemRequest request, LilLogger logger)
 {
     this.actor   = actor;
     this.request = request;
     this.logger  = logger;
     logger.Log("Initialized my FindItemState with request " + request);
 }
예제 #7
0
 public WalkToBlockState(GridActor user, MiningRequest request, LilLogger logger) : base(user, 100, 1)
 {
     this.request = request;
     this.logger  = logger;
     logger.Log("Initialized a WalkToBlockState with request " + request);
     Debug.Assert(this.request != null);
 }
예제 #8
0
        public MineBlockState(GridActor user, IGenericSaveData saveData, LilLogger logger) : base(((SaveData)saveData).parent)
        {
            this.user = user;
            SaveData save = saveData as SaveData;

            this.request = save.request;
            logger.Log("Loading MineBlockState with request " + request);
        }
예제 #9
0
 public WalkToTargetState(GridActor actor, MoveItemRequest request, Item item, LilLogger logger) : base(actor, 100, 1)
 {
     this.actor   = actor;
     this.request = request;
     this.item    = item;
     this.logger  = logger;
     logger.Log("Initialized my WalkToTargetState with request " + request);
 }
예제 #10
0
 public WalkToItemState(GridActor actor, MoveItemRequest request, Vector3Int target, LilLogger logger) : base(actor, 100)
 {
     this.actor   = actor;
     this.request = request;
     this.target  = target;
     this.logger  = logger;
     logger.Log("Initialized my WalkToItemState with request " + request);
 }
예제 #11
0
    public WalkRandomlyJob(GridActor user, LilLogger logger)
    {
        this.logger = logger;
        logger.Log("Starting a WalkRandomlyJob");
        Vector3Int size = SingletonProvider.MainGridMap.GetSize();

        machine = new StateMachine(new WalkRandomlyState(user, logger));
    }
예제 #12
0
        public WalkToBlockState(GridActor user, IGenericSaveData saveData, LilLogger logger) : base(user, ((SaveData)saveData).parent)
        {
            this.logger = logger;
            SaveData save = saveData as SaveData;

            this.request = save.request;
            logger.Log("Loaded a WalkToBlockState with request " + request);
            Debug.Assert(this.request != null);
        }
예제 #13
0
        public FindItemState(GridActor actor, IGenericSaveData saveData, LilLogger logger) : base(((SaveData)saveData).parent)
        {
            this.actor  = actor;
            this.logger = logger;
            SaveData save = saveData as SaveData;

            this.request = save.request;
            logger.Log("Loaded my FindItemState with request " + request);
        }
예제 #14
0
    public MiningJob(GridActor actor, IGenericSaveData save, LilLogger logger)
    {
        this.logger = logger;
        SaveData saveData = (SaveData)save;

        if (saveData.activeState != null)
        {
            machine = new StateMachine(LoadState(actor, saveData.activeState));
        }
    }
예제 #15
0
        public WalkToTargetState(GridActor actor, IGenericSaveData saveData, LilLogger logger) : base(actor, ((SaveData)saveData).parent)
        {
            this.actor  = actor;
            this.logger = logger;
            SaveData save = saveData as SaveData;

            this.request = save.request;
            this.item    = save.item;
            logger.Log("Loaded my WalkToTargetState with request " + request);
        }
예제 #16
0
    public DorfController(IGenericSaveData data, GridActor actor, LilLogger logger)
    {
        SaveData save = (SaveData)data;

        name        = save.name;
        this.logger = logger;
        logger.Log("I'm being loaded");
        this.gridActor    = actor;
        this.stateMachine = new StateMachine(LoadState(save.currentStateSave));
    }
예제 #17
0
    public static T GetComponent <T>(GameObject g, LilLogger logger)
    {
        T comp = g.GetComponent <T>();

        if (comp == null)
        {
            logger.Log("Component " + typeof(T).ToString() + "not found on gameobject " + g.name, LogLevel.Warning);
        }
        return(comp);
    }
예제 #18
0
 private void Start()
 {
     if (logger == null)
     {
         logger = new LilLogger(gameObject.name);
     }
     gridActor  = GetComponent <GridActor>();
     controller = new DorfController(gameObject.name, gridActor, logger);
     logger.Log("I started");
 }
예제 #19
0
    public WalkRandomlyJob(GridActor user, IGenericSaveData save, LilLogger logger)
    {
        this.logger = logger;
        SaveData saveData = (SaveData)save;

        logger.Log("Loading a WalkRandomlyJob");
        if (saveData.activeState != null)
        {
            machine = new StateMachine(LoadState(user, saveData.activeState));
        }
    }
 void Start()
 {
     logger           = new LilLogger(typeof(UnbuiltBuildingGhoster).ToString());
     observer         = new SimpleObserver <PlayerUpdateEvent>(PlayerComponent.Instance, OnPlayerSettingsUpdated);
     filter           = GetComponent <MeshFilter>();
     meshRenderer     = GetComponent <MeshRenderer>();
     seeThroughShader = PrefabLoader.GetPrefab <Shader>("Shaders/SeeThroughShader");
     if (seeThroughShader == null)
     {
         logger.Log("Unable to load Shaders/SeeThroughShader", LogLevel.Warning);
     }
 }
예제 #21
0
 void Start()
 {
     logger     = new LilLogger(gameObject.name);
     visualizer = GetComponent <BlockVisualizer>();
     if (visualizer)
     {
         visualizer.RenderBlock(plannedBlock);
     }
     else
     {
         logger.Log("No BlockVisualizer found on BlockBuildGhoster", LogLevel.Warning);
     }
     oldMousePos = Input.mousePosition;
 }
예제 #22
0
 public MoveItemJob(GridActor actor, MoveItemRequest request, LilLogger logger)
 {
     this.logger = logger;
     logger.Log("Started a MoveItemJob");
     machine = new StateMachine(new FindItemState(actor, request, logger));
 }
예제 #23
0
 public ChoosingJobState(GridActor actor, LilLogger logger)
 {
     this.actor  = actor;
     this.logger = logger;
 }
예제 #24
0
 public WalkRandomlyState(GridActor user, LilLogger logger)
 {
     this.logger = logger;
     this.user   = user;
     logger.Log("Initialized a WalkRandomlyState");
 }
예제 #25
0
 public ChoosingJobState(GridActor actor, IGenericSaveData save, LilLogger logger) : base(((SaveData)save).parent)
 {
     this.actor  = actor;
     this.logger = logger;
 }
예제 #26
0
 public WaitState(LilLogger logger) : base(1000)
 {
     this.logger = logger;
     logger.Log("Starting my WaitState");
 }
예제 #27
0
 public WalkRandomlyState(GridActor user, IGenericSaveData save, LilLogger logger) : base(save)
 {
     this.logger = logger;
     this.user   = user;
 }