Exemplo n.º 1
0
        public static bool IsWater(Point tilePosition, JEventBus eventBus = null)
        {
            FindTileTypeEvent findTileTypeEvent = new FindTileTypeEvent(tilePosition);

            BaseApi.SendEvent(eventBus, findTileTypeEvent);
            return(findTileTypeEvent.Result <= 0);
        }
Exemplo n.º 2
0
        public static int GetTerrainAmountsByType(byte terrainType, JEventBus eventBus = null)
        {
            FindTerrainCellsAmount findTerrainCellsAmount = new FindTerrainCellsAmount(terrainType);

            BaseApi.SendEvent(eventBus, findTerrainCellsAmount);
            return((int)findTerrainCellsAmount.Result);
        }
Exemplo n.º 3
0
        public static bool IsEntrance(Point tilePosition, JEventBus eventBus = null)
        {
            if (eventBus == null)
            {
                eventBus = JEventBus.GetDefault();
            }

            FindEntranceEvent findEntranceEvent = new FindEntranceEvent(tilePosition);

            BaseApi.SendEvent(eventBus, findEntranceEvent);
            return(findEntranceEvent.Result != null);
        }
Exemplo n.º 4
0
        public static bool IsGround(Point tilePosition, JEventBus eventBus = null)
        {
            if (eventBus == null)
            {
                eventBus = JEventBus.GetDefault();
            }

            FindTileTypeEvent findTileTypeEvent = new FindTileTypeEvent(tilePosition);

            BaseApi.SendEvent(eventBus, findTileTypeEvent);
            return(findTileTypeEvent.Result > 0);
        }
Exemplo n.º 5
0
        public static void AddMineToFraction(Entity structureEntity, Fraction fraction, JEventBus eventBus = null)
        {
            Structure structure = structureEntity.GetComponent <Structure>();

            if (structure == null)
            {
                return;
            }

            AddStructureToFractionEvent addStructureToFractionEvent =
                new AddStructureToFractionEvent(structure, fraction, structureEntity);

            BaseApi.SendEvent(eventBus, addStructureToFractionEvent);
        }