Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "feat: wonder model" #2396

Merged
merged 1 commit into from
Dec 10, 2024
Merged

Revert "feat: wonder model" #2396

merged 1 commit into from
Dec 10, 2024

Conversation

bob0005
Copy link
Collaborator

@bob0005 bob0005 commented Dec 10, 2024

This reverts commit ae73dfd.

Summary by CodeRabbit

  • New Features

    • Simplified logic for managing building types and structures within the application.
  • Bug Fixes

    • Removed outdated references to the WONDER_REALM, streamlining the handling of building models.
  • Documentation

    • Updated type definitions for building models and paths to reflect recent changes.

This reverts commit ae73dfd.
Copy link

vercel bot commented Dec 10, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
eternum 🔄 Building (Inspect) Visit Preview 💬 Add feedback Dec 10, 2024 11:45pm
eternum-docs 🔄 Building (Inspect) Visit Preview 💬 Add feedback Dec 10, 2024 11:45pm
eternum-landing 🔄 Building (Inspect) Visit Preview 💬 Add feedback Dec 10, 2024 11:45pm

Copy link
Contributor

coderabbitai bot commented Dec 10, 2024

Walkthrough

The changes in this pull request primarily involve the removal of the getWonder method from the TileManager class and the associated WONDER_MODEL_INDEX constant from the StructureManager class. Additionally, the WONDER_REALM constant has been eliminated from the Hexception scene and the constants.ts file, along with updates to type definitions in the buildingModels Map and buildingModelPaths record. These modifications indicate a simplification in how wonder status and building types are managed across the relevant classes.

Changes

File Path Change Summary
client/src/dojo/modelManager/TileManager.ts Removed method: getWonder from TileManager class.
client/src/three/components/StructureManager.ts Removed constant: WONDER_MODEL_INDEX and associated logic in updateVisibleStructures.
client/src/three/scenes/Hexception.tsx Removed constant: WONDER_REALM from type definition and updated logic in updateHexceptionGrid.
client/src/three/scenes/constants.ts Removed constant: WONDER_REALM and updated buildingModelPaths record type definition.

Possibly related PRs

Suggested reviewers

  • ponderingdemocritus

🐇 In the realm of code, changes abound,
The wonders we had, now lost, yet profound.
With constants removed, and methods that fade,
A simpler path in the logic we've laid.
So hop along, dear friends, let’s embrace the new,
For every change brings a fresh point of view! 🌟


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Experiment)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

mentatbot bot commented Dec 10, 2024

You are out of MentatBot reviews. Your usage will refresh December 16 at 08:00 AM.

Copy link

Failed to generate code suggestions for PR

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 314eb97 and 76936a7.

📒 Files selected for processing (4)
  • client/src/dojo/modelManager/TileManager.ts (0 hunks)
  • client/src/three/components/StructureManager.ts (1 hunks)
  • client/src/three/scenes/Hexception.tsx (1 hunks)
  • client/src/three/scenes/constants.ts (1 hunks)
💤 Files with no reviewable changes (1)
  • client/src/dojo/modelManager/TileManager.ts
🔇 Additional comments (1)
client/src/three/components/StructureManager.ts (1)

17-17: Verify wonder model handling is completely removed.

The WONDER_MODEL_INDEX constant has been removed. This change appears to be part of the wonder feature revert.

Let's verify all wonder-related model handling is removed:

export const buildingModelPaths: Record<
BuildingType | ResourceMiningTypes | RealmLevelNames | HyperstructureTypesNames | typeof WONDER_REALM,
BuildingType | ResourceMiningTypes | RealmLevelNames | HyperstructureTypesNames,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

Wonder-related code still present in multiple locations

Several wonder-related code references still exist across the codebase that may need attention:

  • client/src/three/components/Minimap.ts: Contains wonder-related texture paths and logic
  • client/src/ui/utils/utils.tsx: Has adjustWonderLordsCost function
  • client/src/ui/utils/realms.tsx: Contains wonder-related logic and naming
  • client/src/dojo/modelManager/ResourceManager.ts: Contains wonder-specific resource production logic
  • client/src/three/components/StructureManager.ts: Has wonder-related parameters and logic
🔗 Analysis chain

LGTM: Wonder type successfully removed from buildingModelPaths.

The type definition has been correctly updated to remove the wonder-related type.

Let's verify no other wonder-related constants remain in the codebase:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any remaining wonder-related constants
rg -i 'wonder' --type ts

Length of output: 6653

@@ -98,7 +97,7 @@ interface Building {
export default class HexceptionScene extends HexagonScene {
private hexceptionRadius = 4;
private buildingModels: Map<
BuildingType | ResourceMiningTypes | typeof WONDER_REALM,
BuildingType | ResourceMiningTypes,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

Found remaining wonder-related code that needs attention

The search revealed several remaining wonder-related implementations that should be reviewed:

  • Wonder-related scene handling in label management (MY_REALM_WONDER, REALM_WONDER labels and their loading)
  • Wonder-specific logic for resource costs (adjustWonderLordsCost function)
  • Wonder-related structure properties and handling (hasWonder flag in structures)
  • Wonder-specific resource production rate adjustments

These findings suggest the wonder feature removal is incomplete. The changes should be consistent across the entire codebase.

🔗 Analysis chain

LGTM: Wonder type successfully removed from buildingModels Map.

The type definition has been correctly updated to remove the wonder-related type, consistent with changes in constants.ts.

Let's verify no wonder-related scene handling remains:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any remaining wonder-related scene handling
ast-grep --pattern 'if ($this.tileManager.getWonder()) {
  $$$
}'

# Search for any remaining wonder-related imports or type usage
rg -i 'wonder.*realm|realm.*wonder' --type tsx

Length of output: 144


Script:

#!/bin/bash
# Search for any remaining wonder-related scene handling with ripgrep
rg -i "wonder" --type ts --type tsx -A 3

# Search for any remaining wonder-related imports or type usage
rg -i "wonderrealm|realm.*wonder" --type ts --type tsx

# Search for getWonder method usage
rg -i "getWonder\(" --type ts --type tsx

Length of output: 224


Script:

#!/bin/bash
# Search for any remaining wonder-related scene handling with ripgrep
# Note: Using just typescript extension since tsx isn't recognized
rg -i "wonder" "*.ts"

# Search for getWonder method usage
rg -i "getWonder\(" "*.ts"

# Find all TypeScript files that might contain wonder-related code
fd -e ts -e tsx -x cat {} | rg -i "wonder"

Length of output: 3993

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants