Skip to content
Settlers Journal
Go back

Two-Phase Player Actions and Angular Event Bubbling Through the Component Tree

Edit page

TLDR

Updating UI to allow for two-phase player actions. E.g., placing a settlement requires you click “place settlement” then select a settlement index. Plumbing all the event bubbling that gets a click back to the parent board object.

alt text

onSettlementClickEmit(settlementIndex: number) {
  console.log(
    `Settlement ${settlementIndex} clicked event at settlement grid level.`,
  );
  this.settlementClickEmitter.emit(settlementIndex);
}

Main work

Challenges

Learnings


Edit page
Share this post on:

Previous Post
Implementing Place Road Action and Cleaning Up API Call Logic
Next Post
API Calls Based on Player Action