Esempio n. 1
0
        public override string ToString()
        {
            StringBuilder sb = new StringBuilder("HiveObjectPrivilege(");

            sb.Append("HiveObject: ");
            sb.Append(HiveObject == null ? "<null>" : HiveObject.ToString());
            sb.Append(",PrincipalName: ");
            sb.Append(PrincipalName);
            sb.Append(",PrincipalType: ");
            sb.Append(PrincipalType);
            sb.Append(",GrantInfo: ");
            sb.Append(GrantInfo == null ? "<null>" : GrantInfo.ToString());
            sb.Append(")");
            return(sb.ToString());
        }
Esempio n. 2
0
        public static void init()
        {
            map            = new TestMap();
            players        = new Dictionary <int, Player>();
            buildings      = new Dictionary <int, BuildingObject>();
            characters     = new Dictionary <int, CharacterObject>();
            events         = new Queue <Event>();
            playerCommands = new Queue <PlayerCommandData>();
            gameStates     = new Dictionary <int, GameState>();
            turnNumber     = 0;

            BuildingObject commandCenter = new CommandCenterObject(Map.mapPosition + map.getMarineSpawnPoint());
            BuildingObject hive          = new HiveObject(Map.mapPosition + map.getAlienSpawnPoint());

            buildings.Add(commandCenter.id, commandCenter);
            buildings.Add(hive.id, hive);
        }
Esempio n. 3
0
        public void Write(TProtocol oprot)
        {
            TStruct struc = new TStruct("HiveObjectPrivilege");

            oprot.WriteStructBegin(struc);
            TField field = new TField();

            if (HiveObject != null && __isset.hiveObject)
            {
                field.Name = "hiveObject";
                field.Type = TType.Struct;
                field.ID   = 1;
                oprot.WriteFieldBegin(field);
                HiveObject.Write(oprot);
                oprot.WriteFieldEnd();
            }
            if (PrincipalName != null && __isset.principalName)
            {
                field.Name = "principalName";
                field.Type = TType.String;
                field.ID   = 2;
                oprot.WriteFieldBegin(field);
                oprot.WriteString(PrincipalName);
                oprot.WriteFieldEnd();
            }
            if (__isset.principalType)
            {
                field.Name = "principalType";
                field.Type = TType.I32;
                field.ID   = 3;
                oprot.WriteFieldBegin(field);
                oprot.WriteI32((int)PrincipalType);
                oprot.WriteFieldEnd();
            }
            if (GrantInfo != null && __isset.grantInfo)
            {
                field.Name = "grantInfo";
                field.Type = TType.Struct;
                field.ID   = 4;
                oprot.WriteFieldBegin(field);
                GrantInfo.Write(oprot);
                oprot.WriteFieldEnd();
            }
            oprot.WriteFieldStop();
            oprot.WriteStructEnd();
        }