Skip to content

Commit

Permalink
Move util/Color to data/color/Color
Browse files Browse the repository at this point in the history
  • Loading branch information
AntumDeluge committed May 17, 2024
1 parent b048073 commit 16cbe8e
Show file tree
Hide file tree
Showing 16 changed files with 38 additions and 32 deletions.
3 changes: 2 additions & 1 deletion src/js/stendhal/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import { singletons } from "./SingletonRepo";

import { Paths } from "./data/Paths";

import { Color } from "./data/color/Color";

import { Ground } from "./entity/Ground";
import { RPObject } from "./entity/RPObject";

Expand All @@ -36,7 +38,6 @@ import { DesktopUserInterfaceFactory } from "./ui/factory/DesktopUserInterfaceFa
import { SingletonFloatingWindow } from "./ui/toolkit/SingletonFloatingWindow";

import { Chat } from "./util/Chat";
import { Color } from "./util/Color";
import { DialogHandler } from "./util/DialogHandler";


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@
* *
***************************************************************************/

import { MathUtil } from "./MathUtil";
import { MathUtil } from "../../util/MathUtil";


// TODO: move to `data/color` directory

/**
* Color representation class.
*/
Expand Down Expand Up @@ -228,7 +226,7 @@ export class Color {
*
* @param n {number}
* Value to be converted.
* @return {util.Color.RGBColor}
* @return {data.color.Color.RGBColor}
* RGB color representation.
*/
static numToRGB(n: number): RGBColor {
Expand All @@ -243,7 +241,7 @@ export class Color {
*
* @param n {number}
* Value to be converted.
* @return {util.Color.HSLColor}
* @return {data.color.Color.HSLColor}
* HSL color representation.
*/
static numToHSL(n: number): HSLColor {
Expand All @@ -257,7 +255,7 @@ export class Color {
*
* @param h {string}
* Hex value to be converted.
* @return {util.Color.RGBColor}
* @return {data.color.Color.RGBColor}
* RGB color representation.
*/
static hexToRGB(h: string): RGBColor {
Expand All @@ -276,7 +274,7 @@ export class Color {
*
* @param h {string}
* Hex value to be converted.
* @return {util.Color.HSLColor}
* @return {data.color.Color.HSLColor}
* HSL color representation.
*/
static hexToHSL(h: string): HSLColor {
Expand All @@ -288,9 +286,9 @@ export class Color {
*
* https://css-tricks.com/converting-color-spaces-in-javascript/
*
* @param rgb {util.Color.RGBColor}
* @param rgb {data.color.Color.RGBColor}
* RGB color representation.
* @return {util.Color.HSLColor}
* @return {data.color.Color.HSLColor}
* HSL color representation.
*/
static RGBToHSL(rgb: RGBColor): HSLColor {
Expand Down Expand Up @@ -338,7 +336,7 @@ export class Color {
*
* @param rbg {string}
* RGB formatted string.
* @return {util.Color.RGBColor}
* @return {data.color.Color.RGBColor}
* Object with R/G/B numerical values.
*/
static parseRGB(rgb: string): RGBColor {
Expand All @@ -351,7 +349,7 @@ export class Color {
*
* @parm hsl (strong}
* HSL formatted string.
* @return {util.Color.HSLColor}
* @return {data.color.Color.HSLColor}
* Object with H/S/L numerical values.
*/
static parseHSL(hsl: string): HSLColor {
Expand Down
11 changes: 6 additions & 5 deletions src/js/stendhal/entity/Chest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,16 @@
* *
***************************************************************************/

import { PopupInventory } from "./PopupInventory";

import { MenuItem } from "../action/MenuItem";

import { Color } from "../data/color/Color";

import { FloatingWindow } from "../ui/toolkit/FloatingWindow";
import { ItemInventoryComponent } from "../ui/component/ItemInventoryComponent";

import { PopupInventory } from "./PopupInventory";

import { Chat } from "../util/Chat";
import { Color } from "../util/Color";

import { MenuItem } from "../action/MenuItem";

declare var marauroa: any;
declare var stendhal: any;
Expand Down
2 changes: 1 addition & 1 deletion src/js/stendhal/entity/Creature.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

import { RPEntity } from "./RPEntity";

import { Color } from "../util/Color";
import { Color } from "../data/color/Color";

declare var marauroa: any;
declare var stendhal: any;
Expand Down
4 changes: 2 additions & 2 deletions src/js/stendhal/entity/DomesticAnimal.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/***************************************************************************
* (C) Copyright 2003-2023 - Stendhal *
* (C) Copyright 2003-2024 - Stendhal *
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
Expand All @@ -12,7 +12,7 @@
import { RPEntity } from "./RPEntity";
import { MenuItem} from "../action/MenuItem";

import { Color } from "../util/Color";
import { Color } from "../data/color/Color";

declare var marauroa: any;
declare var stendhal: any;
Expand Down
2 changes: 1 addition & 1 deletion src/js/stendhal/entity/NPC.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

import { RPEntity } from "./RPEntity";

import { Color } from "../util/Color";
import { Color } from "../data/color/Color";

declare var stendhal: any;

Expand Down
2 changes: 1 addition & 1 deletion src/js/stendhal/entity/Player.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { UIComponentEnum } from "../ui/UIComponentEnum";

import { GroupPanelComponent } from "../ui/component/GroupPanelComponent";

import { Color } from "../util/Color";
import { Color } from "../data/color/Color";


export class Player extends RPEntity {
Expand Down
4 changes: 2 additions & 2 deletions src/js/stendhal/entity/Portal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
* *
***************************************************************************/

import { MenuItem } from "../action/MenuItem";
import { Entity } from "./Entity";
import { MenuItem } from "../action/MenuItem";

import { Color } from "../util/Color";
import { Color } from "../data/color/Color";

declare var marauroa: any;
declare var stendhal: any;
Expand Down
4 changes: 3 additions & 1 deletion src/js/stendhal/entity/RPEntity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ import { ActiveEntity } from "./ActiveEntity";
import { Entity } from "./Entity";
import { singletons } from "../SingletonRepo";
import { MenuItem } from "../action/MenuItem";

import { Color } from "../data/color/Color";

import { Chat } from "../util/Chat";
import { Color } from "../util/Color";
import { Nature } from "../util/Nature";

import { Floater } from "../sprite/Floater";
Expand Down
3 changes: 2 additions & 1 deletion src/js/stendhal/entity/User.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import { singletons } from "../SingletonRepo";

import { MenuItem } from "../action/MenuItem";

import { Color } from "../data/color/Color";

import { ui } from "../ui/UI";
import { UIComponentEnum } from "../ui/UIComponentEnum";

Expand All @@ -30,7 +32,6 @@ import { OutfitDialog } from "../ui/dialog/outfit/OutfitDialog";

import { FloatingWindow } from "../ui/toolkit/FloatingWindow";

import { Color } from "../util/Color";
import { Direction } from "../util/Direction";


Expand Down
4 changes: 3 additions & 1 deletion src/js/stendhal/sprite/NotificationBubble.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@
declare var stendhal: any;

import { TextBubble } from "./TextBubble";

import { Color } from "../data/color/Color";

import { NotificationType } from "../util/NotificationType";
import { Color } from "../util/Color";
import { Speech } from "../util/Speech";


Expand Down
3 changes: 2 additions & 1 deletion src/js/stendhal/sprite/SpeechBubble.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ declare var stendhal: any;

import { TextBubble } from "./TextBubble";

import { Color } from "../data/color/Color";

import { RPEntity } from "../entity/RPEntity";

import { Color } from "../util/Color";
import { Pair } from "../util/Pair";
import { Speech } from "../util/Speech";

Expand Down
2 changes: 1 addition & 1 deletion src/js/stendhal/sprite/TextBubble.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

declare var stendhal: any;

import { Color } from "../util/Color";
import { Color } from "../data/color/Color";
import { Pair } from "../util/Pair";


Expand Down
2 changes: 1 addition & 1 deletion src/js/stendhal/ui/component/MiniMapComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { Component } from "../toolkit/Component";

import { Player } from "../../entity/Player";

import { Color } from "../../util/Color";
import { Color } from "../../data/color/Color";


/**
Expand Down
2 changes: 1 addition & 1 deletion src/js/stendhal/ui/component/StatBarComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
***************************************************************************/

import { Component } from "../toolkit/Component";
import { Color } from "../../util/Color";
import { Color } from "../../data/color/Color";

/**
* TODO: move this to `ui.toolkit`.
Expand Down
2 changes: 1 addition & 1 deletion src/js/stendhal/util/NotificationType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* *
***************************************************************************/

import { Color } from "./Color";
import { Color } from "../data/color/Color";


export const NotificationType = {
Expand Down

0 comments on commit 16cbe8e

Please sign in to comment.