<commit_before>package main

import (
	twodee "../libs/twodee"
)

const (
	UpLayer twodee.GameEventType = iota
	DownLayer
	UpWaterLevel
	DownWaterLevel
	PlayerMove
	GameIsClosing
	PlayOutdoorMusic
	PlayExploreMusic
	PlayWarningMusic
	PlayDangerMusic
	PauseMusic
	ResumeMusic
	MenuPauseMusic
	MenuResumeMusic
	PlayerTouchedItem
	PlayerUsedItem
	PlayerDestroyedItem
	sentinel
)

const (
	NumGameEventTypes = int(sentinel)
)

type MoveDirection byte

const (
	None  MoveDirection = iota
	North MoveDirection = 1 << (iota - 1)
	East
	South
	West
)

type PlayerMoveEvent struct {
	*twodee.BasicGameEvent
	Dir     MoveDirection
	Inverse bool
}

func NewPlayerMoveEvent(direction MoveDirection) (e *PlayerMoveEvent) {
	e = &PlayerMoveEvent{
		twodee.NewBasicGameEvent(PlayerMove),
		direction,
		false,
	}
	return
}

func NewInversePlayerMoveEvent(direction MoveDirection) (e *PlayerMoveEvent) {
	e = &PlayerMoveEvent{
		twodee.NewBasicGameEvent(PlayerMove),
		direction,
		true,
	}
	return
}

type PlayerTouchedItemEvent struct {
	*twodee.BasicGameEvent
	Item *Item
}

func NewPlayerTouchedItemEvent(i *Item) (e *PlayerTouchedItemEvent) {
	e = &PlayerTouchedItemEvent{
		twodee.NewBasicGameEvent(PlayerTouchedItem),
		i,
	}
	return
}

type PlayerUsedItemEvent struct {
	*twodee.BasicGameEvent
	Item *Item
}

func NewPlayerUsedItemEvent(i *Item) (e *PlayerUsedItemEvent) {
	e = &PlayerUsedItemEvent{
		twodee.NewBasicGameEvent(PlayerUsedItem),
		i,
	}
	return
}

type PlayerDestroyedItemEvent struct {
	*twodee.BasicGameEvent
	Item *Item
}

func NewPlayerDestroyedItemEvent(i *Item) (e *PlayerDestroyedItemEvent) {
	e = &PlayerDestroyedItemEvent{
		twodee.NewBasicGameEvent(PlayerDestroyedItem),
		i,
	}
	return
}
<commit_msg>Move some anonymous embedded pointer fields to anonymous struct fields in the event structs.<commit_after>package main

import (
	twodee "../libs/twodee"
)

const (
	UpLayer twodee.GameEventType = iota
	DownLayer
	UpWaterLevel
	DownWaterLevel
	PlayerMove
	GameIsClosing
	PlayOutdoorMusic
	PlayExploreMusic
	PlayWarningMusic
	PlayDangerMusic
	PauseMusic
	ResumeMusic
	MenuPauseMusic
	MenuResumeMusic
	PlayerTouchedItem
	PlayerUsedItem
	PlayerDestroyedItem
	sentinel
)

const (
	NumGameEventTypes = int(sentinel)
)

type MoveDirection byte

const (
	None  MoveDirection = iota
	North MoveDirection = 1 << (iota - 1)
	East
	South
	West
)

type PlayerMoveEvent struct {
	twodee.BasicGameEvent
	Dir     MoveDirection
	Inverse bool
}

func NewPlayerMoveEvent(direction MoveDirection) (e *PlayerMoveEvent) {
	e = &PlayerMoveEvent{
		*twodee.NewBasicGameEvent(PlayerMove),
		direction,
		false,
	}
	return
}

func NewInversePlayerMoveEvent(direction MoveDirection) (e *PlayerMoveEvent) {
	e = &PlayerMoveEvent{
		*twodee.NewBasicGameEvent(PlayerMove),
		direction,
		true,
	}
	return
}

type PlayerTouchedItemEvent struct {
	twodee.BasicGameEvent
	Item *Item
}

func NewPlayerTouchedItemEvent(i *Item) (e *PlayerTouchedItemEvent) {
	e = &PlayerTouchedItemEvent{
		*twodee.NewBasicGameEvent(PlayerTouchedItem),
		i,
	}
	return
}

type PlayerUsedItemEvent struct {
	twodee.BasicGameEvent
	Item *Item
}

func NewPlayerUsedItemEvent(i *Item) (e *PlayerUsedItemEvent) {
	e = &PlayerUsedItemEvent{
		*twodee.NewBasicGameEvent(PlayerUsedItem),
		i,
	}
	return
}

type PlayerDestroyedItemEvent struct {
	twodee.BasicGameEvent
	Item *Item
}

func NewPlayerDestroyedItemEvent(i *Item) (e *PlayerDestroyedItemEvent) {
	e = &PlayerDestroyedItemEvent{
		*twodee.NewBasicGameEvent(PlayerDestroyedItem),
		i,
	}
	return
}

{'fraction_non_alphanumeric': 0.07617964752700399, 'fraction_numerical': 0.0011370096645821489, 'mean_word_length': 5.317773788150808, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3894805', 'n_tokens_mistral': 1302, 'n_tokens_neox': 1247, 'n_words': 257}