% +
% 	moz - The Moo in OZ project.
%	Version: 1.0.C025
% 	Copyright (C) 2002 Robin Lee Powell.  All rights reserved.
% 	Written by rlpowell@digitalkingdom.org
% 
% 	Redistribution and use in source and binary forms, with or without
% 	modification, are permitted provided that the following conditions are
% 	met:
% 	
% 	 1. Redistributions of source code must retain the above copyright
% 	 notice, this list of conditions and the following disclaimer.
% 	
% 	 2. Redistributions in binary form must reproduce the above copyright
% 	 notice, this list of conditions and the following disclaimer in the
% 	 documentation and/or other materials provided with the distribution.
% 	
% 	THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
% 	IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
% 	WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
% 	DISCLAIMED. IN NO EVENT SHALL THE AUTHER OR CONTRIBUTORS BE LIABLE FOR
% 	ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
% 	DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
% 	OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
% 	HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
% 	STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
% 	ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
% 	POSSIBILITY OF SUCH DAMAGE.
%
Located = class $ from Described
    %%%%%%%%%
    %
    % Properties
    %
    %%%%%%%%%

    %%%%%%%%%
    %
    % Attributes
    %
    %%%%%%%%%
    attr 
	% location:
	% An object record for this location's own location.
	location

	% Module attributes:
	% These attributes are used to store pointers to the modules
	% that this class needs access to, but that we don't want in
	% this class's scope in general because then objects it creates
	% might be able to see it.
	%string regex

    %%%%%%%%%%%%%%
    %
    % Features
    %
    %%%%%%%%%%%%%%
    feat

	% The list of things that the Server class saves.
	% ozName#name description#string name#string 
	exports: {Append
	    Described.exports
	    [ location#objectRef ]
	}

	% The list of methods we allow the outside world to see, at
	% least potentially
	methodList: {Append
	    Described.methodList
	    [ getLocation ]
	}

	% The name of this class.
	className: 'Located'

    %%%%%%%%%%%%%%
    %
    % Methods
    %
    %%%%%%%%%%%%%%


    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    %
    % init:
    %
    % One-time object initialization sets various values.
    %
    % ozName:  Our new Oz name.
    %
    % storage:  An object record for the Storage object.
    %
    % name:  Our printable name.
    %
    % description:  Our description.
    %
    % location:  Our location.
    %
    %%%%%%%%%%%%%%%%%%%%
    meth init( location: Location <= nil 
		... ) = InitHead
	Described, InitHead

	location <- Location

	{self addPublicMethod( method: getLocation ) }
    end






    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    %
    % start:
    %
    % Called whenever the object is loaded or re-loaded.
    % 
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    meth start( )
	skip
    end


    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    %
    % stop:
    %
    % Stops any processing that may have been started by start.
    %
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    meth stop( ... )
	skip
    end




    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    %
    % getLocation
    %
    % Returns:
    %
    % location:  The object record for this location's location.
    %
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    meth getLocation( location: Location ... )
	Location = @location
    end

end
