19928/jj_vitp/Interface/views/all_widgets_factory.e
Jocelyn Fiat 6dde6425c2 init
2024-06-17 09:09:33 +02:00

81 lines
1.6 KiB
Plaintext

note
description: "[
Class combining the various widget factories into one.
]"
author: "Jimmy J. Johnson"
date: "5/15/24"
copyright: "Copyright (c) 2024, Jimmy J. Johnson"
license: "Eiffel Forum v2 (http://www.eiffel.com/licensing/forum.txt)"
class
ALL_WIDGETS_FACTORY
inherit
ATTACK_WIDGETS_FACTORY
redefine
make_widgets,
extend_widgets,
pair_widgets,
fill_widgets
end
LOCATION_WIDGITS_FACTORY
redefine
make_widgets,
extend_widgets,
pair_widgets,
fill_widgets
end
create
make
feature {NONE} -- Initialization
make_widgets
-- Create widgets for the corresponding game item
-- for each of the ancestors
do
-- create all_widgets.make (100)
print ("ALL_WIDGETS_FACTORY.make_widgets %N")
Precursor {ATTACK_WIDGETS_FACTORY}
Precursor {LOCATION_WIDGITS_FACTORY}
print ("%T end ALL_WIDGETS_FACTORY.make_widgets %N")
end
--feature -- Access
-- all_widgets: VITP_WIDGET_TABLE [VITP_WIDGET, VITP_ITEM]
-- -- Keeps track of all widgets
feature {NONE} -- Implementation
extend_widgets
-- Put each widget into `world'
-- for each of the ancetors
do
Precursor {ATTACK_WIDGETS_FACTORY}
Precursor {LOCATION_WIDGITS_FACTORY}
-- widgets.merge (attack_widgets)
-- widgets.merge (location_widgets)
end
pair_widgets
-- Associate each widget with a unit
-- for each of the ancestors
do
Precursor {ATTACK_WIDGETS_FACTORY}
Precursor {LOCATION_WIDGITS_FACTORY}
end
fill_widgets
-- Call `set_target' to give each widget a target
-- for each of the ancestors
do
Precursor {ATTACK_WIDGETS_FACTORY}
Precursor {LOCATION_WIDGITS_FACTORY}
end
end