}
sub weaken_slot_value {
- my ($self, $instance, $slot_name) = @_;
- weaken $instance->{$slot_name};
+ my ($self, $instance, $slot_name) = @_;
+ weaken $instance->{$slot_name};
}
sub strengthen_slot_value {
- my ($self, $instance, $slot_name) = @_;
- $self->set_slot_value($instance, $slot_name, $self->get_slot_value($instance, $slot_name));
+ my ($self, $instance, $slot_name) = @_;
+ $self->set_slot_value($instance, $slot_name, $self->get_slot_value($instance, $slot_name));
+}
+
+sub rebless_instance_structure {
+ my ($self, $instance, $metaclass) = @_;
+ bless $instance, $metaclass->name;
+}
+
+sub get_all_slot_values {
+ my ($self, $instance) = @_;
+
+ return +{
+ map { $_->name => $_->get_value($instance) }
+ grep { $_->has_value($instance) }
+ $self->associated_metaclass->compute_all_applicable_attributes
+ };
}
# inlinable operation snippets
=item B<set_slot_value ($instance_structure, $slot_name, $value)>
+=item B<get_all_slot_values ($instance_structure)>
+
=item B<initialize_slot ($instance_structure, $slot_name)>
=item B<deinitialize_slot ($instance_structure, $slot_name)>
=item B<strengthen_slot_value ($instance_structure, $slot_name)>
+=item B<rebless_instance_structure ($instance_structure, $new_metaclass)>
+
=back
=head2 Inlineable Instance Operations
=head1 COPYRIGHT AND LICENSE
-Copyright 2006, 2007 by Infinity Interactive, Inc.
+Copyright 2006-2008 by Infinity Interactive, Inc.
L<http://www.iinteractive.com>