Exemplo n.º 1
0
        public static BucketResult HasVegetalNutrimentsInBucket(Vector2Int position)
        {
            foreach (LayerGrid grid in Loki.map.grids.Values)
            {
                LayerGridBucket bucket = grid.GetBucketAt(position);
                if (bucket != null && bucket.properties.vegetalNutriments > 0f)
                {
                    Tilable rt = WorldUtils.ClosestTilableFromEnum(
                        position,
                        bucket.tilables.Where(
                            t =>
                            t != null &&
                            Loki.map[t.position].reserved == false &&
                            t.def.nutriments > 0
                            )
                        );

                    if (rt != null)
                    {
                        return(new BucketResult {
                            result = true,
                            bucket = bucket,
                            tilable = rt
                        });
                    }
                }
            }

            return(new BucketResult {
                result = false,
                bucket = null,
                tilable = null
            });
        }
Exemplo n.º 2
0
		public Tilable GetTilableAt(Vector2Int position) {
			LayerGridBucket bucket = this.GetBucketAt(position);

			if (bucket != null) {
				return this.GetBucketAt(position).GetTilableAt(position);
			}

			return null;
		}